Get a Connect Widget URL
To get started with the Connect Widget, you will first need to create a user and then get a widget URL by making aPOST request to /users/{user_guid}/connect_widget_url. You can also use one of our wrapper libraries to make this request.
Configuration and Integration
For complete information on correctly configuring and integrating the Connect Widget into your website or app, please see our comprehensive Connect reference. Examples in this reference use the Platform API, but all configuration options and details in the integration guides apply to Connect in the Atrium API as well.Embedding in Webviews
Because of the technical limitations of WebView-based implementations, an alternative to standard postMessages is required. If Connect is configured withis_mobile_webview set to true, we will use navigation events with window.location = url instead of window.postMessage(message)
ui_message_webview_url_scheme will be atrium:// by default.
Example navigation event schema
{ui_message_webview_url_scheme}://{some/path}?metadata={jsonString}
Request
Using OAuth in Connect with WebViews
INFOAll new clients making use of WebViews will need to use the OAuth methods described here. Existing clients will need to adjust their implementations.
is_mobile_webview: true— Allows the widget to know if it is in a WebView context.ui_message_version: 4— Allows the widget to send new postMessage events.ui_message_webview_url_scheme: <your app>— Determines message scheme; this is is used by MX to redirect the user back to the client app in mobile contexts.
Request
Redirecting the User
Since the MX WebView can’t reliably send the user from the app to the OAuth provider’s site in a native browser, the containing iOS or Android app will need to. To facilitate this, your app will need to react to theconnect/oauthRequested postMessage request:
<ui_message_webview_url_scheme>://connect/oauthRequested?metadata=...
The OAuth URL is inside of the metadata query parameter under the url key.
Example redirect
Getting Back To Your App
Once the user completes the OAuth process, MX will send the user back to the client app via a URL scheme like so:<ui_message_webview_url_scheme>://oauth_complete?status=<success|error>&member_guid=<guid>
This part is optional for OAuth, but highly recommended. If this is not set, the user will end on an MX page with a success or error message and will have to navigate back to your app manually. Make sure to pick a scheme that your app can respond to.
