Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth.federatedSignIn returns to me Invalid login token after login #858

Closed
VTSingle opened this issue Apr 24, 2020 · 1 comment
Closed

Comments

@VTSingle
Copy link

When I using aws-amplify && react-native-google-signin I getting every time Invalid login token. Not a valid OpenId Connect identity token.

Example of my code:

GoogleSignin.configure({ webClientId: '**************', });

signUpViaGoogle = async () => {
try {
const userInfo = await GoogleSignin.signInSilently();
await GoogleSignin.getTokens().then(user => {
Auth.federatedSignIn('google', {token: user.accessToken})
.then((result: any) => {
console.log('result => ', result);
})
.catch((err: any) => {
console.log('err 1 => ', err);
});
});
};

can someone help me?

@isaac-peka
Copy link

You're passing the wrong token to cognito - you need to pass the id token rather than the access token. Take a look at this example here (the getAWSCredentials function is the relevant bit): https://docs.amplify.aws/lib/auth/advanced/q/platform/js#google-sign-in-react

@vonovak vonovak closed this as completed Oct 2, 2021
@react-native-google-signin react-native-google-signin locked and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants