Skip to main content

Hybrid Mobile Webapps

If you are embedding the Connect Widget in a webapp that is itself embedded in a WebView, there are some additional options for you.

The first change you may want to make is_mobile_webview: false (or omit entirely). This would allow your webapp and the Connect Widget to communicate via postMessages just like they would in a browser setting.

Then you would want to use oauth_referral_source: "APP". This tells MX that you want us to redirect the user at the end of OAuth, instead of using postMessages in a browser.

Example URL Request


_12
curl -i -X POST 'https://int-api.mx.com/users/USR-11141024-90b3-1bce-cac9-c06ced52ab4c/widget_urls' \
_12
-u '{client_id}:{api_key}' \
_12
-H 'Accept: application/vnd.mx.api.v1+json' \
_12
-H 'Content-Type: application/json' \
_12
-d '{
_12
"widget_url": {
_12
"widget_type": "connect_widget",
_12
"ui_message_version": 4,
_12
"client_redirect_url": "{your_url_here}",
_12
"oauth_referral_source": "APP"
_12
}
_12
}'

Example URL Response


_10
{
_10
"widget_url": {
_10
"type": "connect_widget",
_10
"url": "https://int-widgets.moneydesktop.com/md/connect/yxc...snip...Ay5",
_10
"user_id": "u-abc-789"
_10
}
_10
}

From here, you would still want to listen for the OAuth requested postMessage in your webapp, then message the URL to your mobile app, so it can redirect them via the mobile device's browser. Once OAuth is completed, MX will redirect the user back to your client_redirect_url.

A workflow explaining how OAuth redirects