React Native Expo AuthSession; Google Authentication

Viewed 204

I’m trying to setup the Google authentication using AuthSession in Expo documentation (without Firebase) https://docs.expo.dev/guides/authentication/#google

The first problem is, that the slack example doesn’t work: on the devices and simulators nothing happen after pushing the button, and in web mode it returns an error

Error 401: invalid_client

The OAuth client was not found.

What I’ve done using steps in documentation:

  • I’m not sure if it’s necessary, but I’ve installed yarn add expo-application

  • I’ve registered in Credentials page (Google Cloud Platform)

  • Logged in using expo login, in the terminal where I was starting expo start

  • Created a new Google Client ID that will be used with expoClientId

(Image) New Google Client ID setting image

( I'm not allowed to input images now )

(Don’t know if it’s necessary) I’ve created a project in https://expo.dev/ and then published the project using dashboard of expo start

(Image) Setting for "publish" in expo start dashboard

Where:

“expo”: {
  “name”: “rn-my-project”,
  “slug”: “rn-my-project”,
  “version”: “1.0.0”,
  “orientation”: “portrait”,
  … 
}

Using the code in the example, provided in documentation for Google, I receive null as response.

As I understand, this should be enough to test the Google Authentication using AuthSession in Expo Go app. I also made iosClientId, androidClientId and webClientId, but I’m not sure if I made everything correct.

Will be glad for any help, because I couldn’t find any person with the problem as mine.

Yours sincerely.

P.S. I've successfully set up logInAsync for Google using this documentation, but it's written, that it is deprecated.

0 Answers
Related