- Website using an iFrame: See Browser
- Mobile app using a WebView: See Mobile (WebView)
- Mobile app using an iFrame inside a WebView: See Mobile (iFrame in a WebView)
NOT USING OUR CONNECT WIDGET?Instead, see OAuth in Browsers or OAuth in Mobile Apps.
Prerequisites
You must register for OAuth with the financial institution unless you’re using one of our test institutions. See Registration for more information.Browser Workflow
For browser integrations, the widget handles most of the OAuth flow automatically. You only need to capture one widget event to know when to close it.- Widget loads and user selects an OAuth-supported institution.
- User selects Go to log in.
- Widget opens the financial institution’s OAuth window in the default browser.
- User authenticates and selects data to share.
- After authorization, users may see a brief redirect screen.
- A connection status screen shows a loading indicator.
- Once connected, and the user selects Done, Member Connected, Primary Action Selected widget event is sent.
- You close the widget, unless you want the user to stay and connect more accounts.
is_mobile_webviewis set tofalseor omittedoauth_referral_sourceis set to"BROWSER"or omitted
Mobile (WebView) Workflow
When you embed the widget in a mobile app’s WebView, your app must handle redirects to the OAuth provider and back.-
You send a widget URL request and set
is_mobile_webviewtotrue(sends widget events towindow.locationinstead ofwindow.postMessage). - Widget loads and user selects an OAuth-supported institution.
- User selects Go to log in.
- Widget triggers the OAuth Requested widget event.
-
Your app opens the OAuth URL from that widget event in an
ASWebAuthenticationSession(iOS) or Auth Tab (Android). - User authenticates and selects data to share.
-
User is redirected back to your app through a custom URL:
- The user is redirected to the URL in the
client_redirect_urlrequest parameter that your app can respond to when linked from a browser. oauth_referral_sourcemust be set to"APP".- Once OAuth is complete, MX sends the user to the
client_redirect_urlwith additional query parameters that describe what happened.
- The user is redirected to the URL in the
Example - Redirect User to Custom URL
Set theclient_redirect_url parameter to specify where users are redirected after OAuth.
MX appends query string parameters to the supplied client_redirect_url to describe what happened during OAuth: https://example.com?status={success|error}&member_guid={member_guid}&error_reason={error_reason}
For example, if you set client_redirect_url: "https://example.com", the user is sent to https://example.com?status=success&member_guid={MBR-XXX}. If you set client_redirect_url: "https://example.com?state=mystate", the user is sent to https://example.com?state=mystate&status=success&member_guid={MBR-XXX}.
Query string parameters
Query string parameters
Request
Mobile (iFrame in a WebView) Workflow
If you embed the widget in an iFrame inside a mobile app’s WebView, follow Mobile (WebView), then consider the following:-
After OAuth, do you need to redirect the user back to a native app? If so, you must set
oauth_referral_sourcetoAPP, so after OAuth the widget redirects the user to theclient_redirect_urlor theui_message_webview_url_scheme. -
Do you want widget events to send to
window.opener, a custom URL, or custom app scheme? To allow the Connect Widget to send widget events via postMessages:- Set
is_mobile_webviewtofalse. - Set
oauth_referral_sourcetoAPP. This tells MX to redirect the user at the end of OAuth to theclient_redirect_urlyou set, instead of using postMessages in a browser. - Listen for the OAuth Requested widget event in your web app, then message the URL to your mobile app, so it can redirect the user in an
ASWebAuthenticationSession(iOS) or Auth Tab (Android). After OAuth, MX redirects the user back to yourclient_redirect_url.
- Set
If you set
is_mobile_webview to true, the widget:- Sends widget events to the WebView via
window.location = {scheme}://{event path}?metadata={json encoded metadata}instead ofwindow.postMessage(eventObject). - Sets
oauth_referral_sourcetoAPP, so the OAuth flow redirects back to a native app instead of sending a postMessage to the opening window. - Doesn’t automatically open an OAuth window. Instead, it sends the OAuth Requested widget event so your app can correctly open the OAuth window in the user agent.

