@@ -48,6 +48,7 @@ public class SymphonyBdk {
4848 private final ExtensionAppAuthenticator extensionAppAuthenticator ;
4949
5050 private final AuthSession botSession ;
51+ private final ExtAppAuthSession extAppAuthSession ;
5152 private final UserV2 botInfo ;
5253 private final DatafeedLoop datafeedLoop ;
5354 private final DatahoseLoop datahoseLoop ;
@@ -64,6 +65,9 @@ public class SymphonyBdk {
6465 private final HealthService healthService ;
6566 private final ExtensionService extensionService ;
6667
68+ private final ExtAppServices extAppServices ;
69+
70+
6771 /**
6872 * Returns a new {@link SymphonyBdkBuilder} for fluent initialization.
6973 *
@@ -128,6 +132,15 @@ protected SymphonyBdk(
128132 this .messageService = serviceFactory != null ? serviceFactory .getMessageService () : null ;
129133 this .disclaimerService = serviceFactory != null ? serviceFactory .getDisclaimerService () : null ;
130134
135+ if (config .isOboConfigured ()) {
136+ ExtAppAuthenticator extAppAuthenticator = authenticatorFactory .getExtAppAuthenticator ();
137+ this .extAppAuthSession = extAppAuthenticator .authenticateExtApp ();
138+ this .extAppServices = new ExtAppServices (apiClientFactory , this .extAppAuthSession , this .config );
139+ } else {
140+ this .extAppServices = null ;
141+ this .extAppAuthSession = null ;
142+ }
143+
131144 // retrieve bot session info
132145 this .botInfo = sessionService != null ? sessionService .getSession () : null ;
133146
@@ -304,6 +317,14 @@ public OboServices obo(AuthSession oboSession) {
304317 return new OboServices (config , oboSession );
305318 }
306319
320+ /**
321+ * Get an {@link ExtAppServices} gathering all extension app enabled services
322+ * @return an {@link ExtAppServices} instance
323+ */
324+ public ExtAppServices app () {
325+ return this .extAppServices ;
326+ }
327+
307328 /**
308329 * Returns the {@link ExtensionAppAuthenticator}.
309330 *
@@ -313,6 +334,17 @@ public ExtensionAppAuthenticator appAuthenticator() {
313334 return this .getExtensionAppAuthenticator ();
314335 }
315336
337+ /**
338+ * Returns the extension app auth session.
339+ *
340+ * @return extension app auth session.
341+ */
342+ @ API (status = API .Status .EXPERIMENTAL )
343+ public ExtAppAuthSession extAppAuthSession () {
344+ return Optional .ofNullable (this .extAppAuthSession )
345+ .orElseThrow (() -> new IllegalStateException ("Cannot get App auth session. Ext app is not configured." ));
346+ }
347+
316348 /**
317349 * Returns the Bot session.
318350 *
0 commit comments