Setting up google / facebook authentication in react-native app
See original GitHub issueWhich Category is your question related to? Authentication
What AWS Services are you utilizing? Cognito
Provide additional details e.g. code snippets
I was trying to set up google authentication following these steps
- Generated credentials for ios and web clients of my app in google cloud console
amplify update auth
(already had auth set up as I am using@auth
in my graphql api)- Went ahead and configured everything to use google as third party provider (it was odd I only got asked for web client id here, more on this latter). I also disabled email password recovery here and used sms instead.
amplify push
- I added federated sign in as follows
await Auth.federatedSignIn(
'google',
{ token: idToken, expires_at: idTokenExpirationDate },
{ email, name }
);
const currentUser = await Auth.currentAuthenticatedUser();
I logged out all data passed to Auth
(tokens, expiry, user etc…) and am sure it is correct.
Yet, when I try to log in I get following error:
Token is not from a supported provider of this identity pool
Am I missing something? I logged into aws console and went to user pool in Cognito that was generated by amplify, inside it nothing related to google is enabled, do I need to do this manually i.e. Add web client details in and tick / enable Google
as option in my web and app clients?
And finally related to only using web token everywhere, when I get user idTokens and other data from Google, it actually comes from ios where I use ios client id from google plist (react native project)? I need to use ios client id as I am using native google sdk, is this an issue?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:14 (6 by maintainers)
@IljaDaderko - For now these will need to be manual, but yes eventually this should be totally automated through CLI. It’s in our backlog.
Our federated signin documentation shows a non-Expo method for getting the google token… I’m assuming that’s what you are using.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels for those types of questions.