- SDK Version: 37.0.12
- Platforms(Android/iOS/web/all): Android/(all?)
I am having issues with the implementation of Expo Auth Session.
I am trying Google Oauth Login in Expo Auth Session as documented here: https://docs.expo.io/guides/authentication/#google
WebBrowser.maybeCompleteAuthSession();
const GoogleButton = () => {
// Endpoint
const discovery = useAutoDiscovery('https://accounts.google.com');
// Request
const [request, response, promptAsync] = useAuthRequest(
{
clientId: 'MYID',
scopes: ['email', 'profile'],
// For usage in managed apps using the proxy
redirectUri: makeRedirectUri({
// For usage in bare and standalone
native: 'com.googleusercontent.apps.MYID://redirect',
useProxy: true,
}),
},
discovery,
);
console.log(request);
console.log(response);
return (
<Button
onPress={promptAsync}
icon={GoogleIcon}
/>
);
};
The browser opens, I can successfully log in with google, but when I get redirected to the app, response resolves to Object { "type": "dismiss", }
I also tried implementing oauth with a different oauth service:
WebBrowser.maybeCompleteAuthSession();
const HiveButton = () => {
// Endpoint
const discovery = {
authorizationEndpoint:
'https://hivesigner.com/login-request/my.app',
};
// Request
const [request, response, promptAsync] = useAuthRequest(
{
scopes: ['posting'],
// For usage in managed apps using the proxy
redirectUri: makeRedirectUri({
useProxy: true,
}),
},
discovery,
);
console.log(request);
console.log(response);
return (
<Button
onPress={promptAsync}
icon={HiveIcon}
/>
);
};
The browser opens, I can log in successfully, but instead of being redirected to the app, I get “Something went wrong trying to finish signing in. Please close this screen to go back to the app.” on auth.expo.io/@me/myapp, even though the parameter code has the correct login token that I want to pass to my app.