We've integrated SSO sign-in in the WeWork mobile app and it works end-to-end
with a standard Okta-style IdP. For the Amazon Federate client it currently
fails on mobile, because Federate routes to Midway, and Midway tries to open
an external app on the same device (aea://). A mobile in-browser sign-in cannot
launch that app, so the flow dead-ends.
We believe the fix is for Federate to use a device-code / polling flow on
mobile (the same activate.amazon-corp.com code screen Amazon already has),
instead of the same-device app hand-off. That pattern works in a mobile browser
exactly like our Okta flow does. This doc explains all three flows and what we
need from your side.
The WeWork app opens the IdP in the device's system browser (Chrome Custom
Tabs on Android, ASWebAuthenticationSession on iOS) and waits for a redirect to
our registered callback URL, which the app intercepts.
The system browser can follow web redirects and poll, but it cannot
reliably launch a separate native app mid-flow (e.g. via an aea:// link). So
any IdP step that depends on opening another app on the same device breaks the
mobile flow. Authentication that happens out-of-band (on another device, or
via a background push) and then redirects the browser page to the callback
works perfectly.
This is live and working in our app today.
Why it works: the approval happens out-of-band, the browser page just polls, and on success the same page redirects to our callback. The browser never has to open another app.
Why it fails: Midway requires the browser to launch the AEA app on the same
device via aea://. In a mobile system browser that hand-off does not happen
(app not present / the auth session will not launch a third-party app), so the
flow never reaches our callback. This is a hard limitation of mobile browsers,
not something we can work around in the app.
This matches the activate.amazon-corp.com screen Amazon already shows (enter a
code on your computer, the phone screen waits). It restores the same out-of-band
The mobile phone never needs the AEA app. AEA/Midway runs where it already works (the managed laptop), and the phone's browser simply polls and then redirects to our callback, just like Okta.
wework-india-staging) instead of the Midway aea:// same-device app
redirect. Mobile should land on the activate.amazon-corp.com style code
screen and poll.code and state. Our redirect URI is:
https://wwistaging.in/auth/sso/callback.code + state on the
redirect; we exchange them server-side as we do today).authorize parameter or client configuration on your side.If a device-code flow is not available, the alternative is any auth method that does not require launching the AEA app on the phone (credentials/MFA in the page, or out-of-band push) and ends by redirecting the browser to our callback.
We open the IdP in the OS system browser specifically because it is the secure,
standard way to do SSO on mobile and lets the redirect hand back to our app. That
same browser will not launch the AEA app for us, and embedding a custom in-app
browser to force-launch aea:// is both unreliable and a security regression. The
clean fix is the device-code flow above, which keeps all Amazon authentication on
the managed device where it is designed to run.
If the device-code flow is not possible and you want us to support the same-device AEA app hand-off instead, that is a larger, non-standard effort. Before we could commit to it, we would need the following from your team:
aea://...), and whether it is
stable across environments.https://wwistaging.in/auth/sso/callback) directly, hand back to the browser
that launched it, or open a scheme our app must register? We need the exact
return URL/scheme and the code + state contract on that return. Without
this, even if we open the AEA app, we have no defined way for the result to
return to the WeWork app, so the loop cannot close.aea:// hand-off.ASWebAuthenticationSession), including whether iOS even allows
the auth session to launch the AEA app.A tempting shortcut is to host the IdP in an in-app WebView (a browser embedded
inside our app) so we could detect and launch aea:// ourselves. We deliberately
do not do this, because it is a security regression and is rejected by SSO best
practice:
The system browser (Custom Tabs / ASWebAuthenticationSession) is the secure,
sanctioned approach, which is why our integration uses it and why the device-code
flow is the right fix.