question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting up google / facebook authentication in react-native app

See original GitHub issue

Which 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

  1. Generated credentials for ios and web clients of my app in google cloud console
  2. amplify update auth (already had auth set up as I am using @auth in my graphql api)
  3. 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.
  4. amplify push
  5. 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
haverchuckcommented, Oct 25, 2018

@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.

0reactions
github-actions[bot]commented, May 27, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-Native: Adding Facebook and Google Authentication ...
Go to the Firebase console. · In the center of the project overview page, click the Android icon (plat_android) to launch the setup...
Read more >
Facebook login in React Native apps - Enappd
Step 1: Create a basic React Native app · Step 2: Facebook Developer Console — Create your app · Step 5: Running Apps...
Read more >
React-Native: Google and Facebook Authentication
Learn how to create Google and Facebook Authentications using React-Native.
Read more >
How to integrate Facebook authentication in React Native
In this shot, we'll learn to integrate Facebook authentication in React Native for the Android version of the application. Installation. We use the...
Read more >
React-Native: Facebook and Google Login - Stack Overflow
The final correct solution is https://github.com/fullstackreact/react-native-oauth. It has a very good installation guideline and worked very ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found