
Mobile Widgets OAuth Flow
This diagram illustrates the OAuth authentication flow for third-party integrations (e.g., Hubspot) within mobile widgets using the Remix Container App.
Flow Overview
The mobile widgets OAuth flow is unique in that it begins directly from a widget on the user's device and leverages the device's default browser for authentication. The Remix Container App orchestrates the navigation between different flows (_rmx_widgets and _rmx_home) to manage the authentication process while keeping the user experience smooth.
Step-by-Step Process
- Widget Setup: User installs the app containing widgets and sets a widget on their device. The widget displays a view prompting: "Tap to begin sign in".
- Initiation: User taps the sign-in prompt on the widget, which redirects them to the Remix Container App installed on their device.
- OAuth Screen Navigation: The container app navigates to the
oauth_signin screen in the _rmx_widgets flow.
- Open Link Execution: The
oauth_signin screen executes an open link action that opens the OAuth URL in the user's device default browser.
- Background Navigation: While the browser opens, the Remix Container App simultaneously navigates to the home screen in the
_rmx_home flow.
- User Authentication: The user completes the OAuth sign-in process in their device's default browser on the third-party platform (Hubspot).
- Return to Container: After successful authentication, the browser redirects back to the Remix Container App, specifically to the
confirmation screen in the _rmx_widgets flow.
- Widget Reload: The confirmation screen reloads all widgets, allowing them to access and use the newly acquired authentication token.
- Home Navigation: The confirmation screen then navigates the user to the home screen in the
_rmx_home flow.
- Completion: The user manually navigates to the screen where their widgets are located. The widgets are now functioning with the authenticated token.
Dependencies
For this OAuth flow to function properly, _rmx_widgets must include two required screens:
oauth_signin - Executes the open link action to launch the OAuth URL in the device's default browser
confirmation - Handles post-authentication by reloading all widgets so they can use the new token, then navigates to home screen