expo-auth-session not redirecting back to app when using facebook OAuth
See original GitHub issueSummary
Facing an issue with Facebook Login. On real android device not redirecting to app. Getting blank screen with url https://m.facebook.com/v12.0/dialog/oauth/confirm after facebook authorization screen.
Working as expected with expo go.
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
46
Environment
System: OS: Windows 10 10.0.19044 Binaries: Node: 14.17.5 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD npm: 6.14.14 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 2020.3.0.0 AI-203.7717.56.2031.7583922 npmPackages: expo: ^46.0.2 => 46.0.2 react: 18.0.0 => 18.0.0 react-dom: 18.0.0 => 18.0.0 react-native: 0.69.3 => 0.69.3 react-native-web: ~0.18.7 => 0.18.7 Expo Workflow: bare
Reproducible demo
const useProxy = (Constants.appOwnership === 'expo') ? true : false;
const redirectUri = AuthSession.makeRedirectUri({
native: `fb${Configs.App.FB_APP_ID}://authorize`,
useProxy
})
console.log(Constants.appOwnership, useProxy);
const [request, response, promptAsync] = Facebook.useAuthRequest({
clientId: Configs.App.FB_APP_ID,
scopes: ["public_profile", "email", "user_location", "user_hometown"],
redirectUri: redirectUri
});
React.useEffect(() => {
userAuth = async () => {
try {
if (response?.type === 'success') {
const { authentication } = response;
console.log(authentication.accessToken);
} else {
console.log(response?.type);
}
} catch (e) {
console.log(e);
}
}
userAuth();
}, [response]);
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:17 (1 by maintainers)
Top Results From Across the Web
expo-auth-session not redirecting back to app when using ...
I am trying to build OAuth flow using expo-auth-session, the app supports login through both facebook and google, when using google oauth ......
Read more >AuthSession - Expo Documentation
If the URL that the auth service is redirecting back to does not match the published URL for the app or the standalone...
Read more >Use expo-auth-session with Facebook the Easiest Way on iOS ...
To do this you need to combine useProxy: true and a hand-defined redirectURL argument that will generate the link in auth.expo.io ALL THE...
Read more >Expo Facebook · Providing Login with Facebook
Preparation · Install expo-auth-session · Create the Facebook Application · Update the configuration · Add a login button · Test it out ·...
Read more >Expo AuthSession Redirect Proxy
Configure the authentication provider to redirect directly to your app, typically with a deep link with your app's own URL scheme. In your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Found something that works for us:
note the second useProxy there. Maybe try if this helps you
Same issue here