Context
OAuthProviderButtons starts the provider redirect with:
window.location.assign(data.authorizationUrl);
There is no window.location in React Native. A native client has to open the
authorization URL in an in app browser session and receive the result back through the
app's URL scheme.
Scope
- Put the redirect behind a port, with a
window.location implementation on web and an
in app browser session (expo-web-browser) on native.
- Handle the callback through the app scheme rather than a route in a DOM router.
Notes
The API side already supports this. resolveOAuthRedirectUri matches a requested
redirect URI exactly against the provider allowlist before falling back to origin
comparison, so a custom scheme such as myapp://oauth/callback is accepted today with no
API change, as long as it is registered on the provider.
Context
OAuthProviderButtonsstarts the provider redirect with:There is no
window.locationin React Native. A native client has to open theauthorization URL in an in app browser session and receive the result back through the
app's URL scheme.
Scope
window.locationimplementation on web and anin app browser session (
expo-web-browser) on native.Notes
The API side already supports this.
resolveOAuthRedirectUrimatches a requestedredirect URI exactly against the provider allowlist before falling back to origin
comparison, so a custom scheme such as
myapp://oauth/callbackis accepted today with noAPI change, as long as it is registered on the provider.