Google Sign In broken in Expo 32

So… there seems to have been some significant change in the Google Sign In in Expo 32… a lot of the original config settings have been deprecated apparently…

https://docs.expo.io/versions/latest/sdk/google/

All the client IDs property have been dropped and there’s a new single clientId.

There was no mention of those changes in the Expo 32 release blog post… I would have called that breaking changes but anyway.

Can’t seem to get it to work.

The original code throws this error

And if we try to use a new web key for the new clientId property we get this:

Has anyone been running into the same issues with Sdk 32 ?

Ben

4 Likes

I know @bacon was working on this, check https://twitter.com/Baconbrix/status/1086441532763193344

We’ve tried this.

We can get it to work on iOS but not Android.

So frustrating…

There is a lot more information here regarding your general frustration rather than the issue itself. What happens when the authentication doesn’t work? Is a modal shown, is an error thrown?

GoogleSignIn was made in accordance to a change that Google made which prevented any kind of sandboxing native authentication.
The android client IDs did nothing in the prior releases, and the web client ID was the server ID. Removing these is more of a clarification rather than a feature.

Can you confirm that you have configured your project in accordance to the setup guide in the docs. Google Sign-In Setup
Consider that there is no way to set the client ID during runtime on Android, meaning there is no JS property that you can set. You need to define the relative path to your google-services.json in the app.json as specified in step 6. On the API side your project also needs to have authentication enabled.

On Android everything API related is automatic. Meaning it is not related to a bug in the Expo API layer. You will also need to ensure that GoogleSignIn.getPlayServiceAvailability() returns true as well.

the issue is directly related to the URI redirect. Could you please share that value (with the API key obfuscated if you’d like (even though it’s a public value)). I’m suspecting that in standalone you may need to use the reverse client ID instead of a package ID. But hard to determine.

@bacon

We’re investigating based on your feedback and will let you know what we find.

And thanks for your input on this, much appreciated!

Hello! I have been stuck on this problem too. I am trying to test the google sign in feature with Expo client on an Android Emulator. I have a WEB type client id. My code looks like this:

Google.logInAsync({ clientId: 'abc123.apps.googleusercontent.com' })

Chrome launches and I get Error: redirect_uri_mismatch

Details:

redirect_uri=host.exp.exponent:/oauthredirectclient_id=abc123.apps.googleuser
response_type=code
state=abcxyz
scope=profile email openid
code_challenge=abc123
code_challenge_method=s256 

on a side note, types are wrong for "@types/expo": "^32.0.3",

interface LogInConfig {
        androidClientId?: string;
        androidStandaloneAppClientId?: string;
        iosClientId?: string;
        iosStandaloneAppClientId?: string;
        webClientId?: string;
        behavior?: 'system' | 'web';
        scopes?: string[];
    }

Same issue happened to me after upgrading to Expo 32. Reverting back to 31 fixed it.

I have the same problem using the expo client, sdk version 32 on android.

I get this error when trying to authenticate using the web client id: "Custom scheme URIs are not allowed for 'WEB' client type".

Any progress on this?

Your answer relates to bare/stand-alone apps and not us using the Expo.Google in the expo client right? Do I have to eject my expo client app in order to use your new GoogleSignIn module? If that’s the case why does it say it’s pre-installed in managed expo projects? Sorry for many questions but this is confusing.

@bacon Hi! Just wanted to ping you for help.

My Google Sign in is broken since upgrading to SDK 32 on both standalone builds and development. I get an error on Google.logInAsync() and even when I try AppAuth.authAsync()

Cannot read property ‘OAuthRedirect’ of undefined

const { type, accessToken } = await Google.logInAsync({
          behavior: 'web',
          scopes: ['profile', 'email'],
          webClientId: '123',
          iosClientId: '234',
          androidClientId: '345'
        })

Any help?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.