Expo not proxying IP address correctly with expo-auth-session

Please provide the following:

  1. SDK Version: 49.0.6
  2. Platforms(Android/iOS/web/all): iOS

Currently building an iOS app using Expo CLI / Expo Go and trying to implement Google SSO within using expo-auth-session. I can get to the google sign in page, but every time I try signing in I keep getting a redirect URI error from Google (see below) showing my Expo server IP being used as the redirect URI when it should be getting proxied by expo-auth-session to https://auth.expo.io/@userName/appSlug.

Error 400: invalid_request
Request details: redirect_uri = exp://192.XXX.XX.XXX:XXXX

Below is my the section of my code where I initiate the proxy. Anyone have any ideas?

const WelcomeScreen = () => {
  const [request, response, promptAsync] = Google.useIdTokenAuthRequest(
    {
      clientId: 'XXXXXXXXX-XXXXXXXXXXXXXX.apps.googleusercontent.com',
      selectAccount: true,
    },
    {
      useProxy: true,
      responseType: ResponseType.Token,
    }
  );

  1. SDK Version: 49.0.0
  2. Platforms(Android/iOS/web/all): Android

I hit a similar issue, tried google and youtube videos, spent hours, no go. This function worked on 46.0.21, then recently got forced to upgrade to 47 or 48 or 49, chose 49 and hit 2 errors:

Error 1) useAuthRequest() now requires androidClientId, previously expoClientId (Client ID for Web application) alone was fine. My new usage is:
const [request, response, promptAsync] = Google.useAuthRequest({
responseType: ‘token’,
androidClientId: ‘.apps.googleusercontent.com’,
expoClientId: ‘.apps.googleusercontent.com’,
});

got that resolved but can’t get past this…

Error 2) error from google:
Access blocked: Authorization Error
Error 400: invalid_request
Request details
redirect_uri=exp://10.0.0.61:19000

redirect_uri is exp://10.0.0.61:19000

But google developer cloud won’t (Invalid Origin: must use either http or https as the scheme) accept URI scheme other than http or https in “Authorized JavaScript origins” and “Authorized redirect URI”.

Others are stuck on perhaps something similar: Can't login using google login method · Issue #16220 · expo/expo · GitHub

Could this be an expo issue?

looks like expo deprecated Google authentication inside expo-auth-session:

Deprecated. See [Google authentication]

on Jul 4: We’ve deprecated Google auth provider from expo-auth-session starting SDK 49. We recommend using a native library such as @react-native-google-signin/google-signin.

Yes running into exactly that pattern @cibym. My issue is I really don’t want to eject from using Expo Go into a custom build, which is required if you want to use @react-native-google-signin/google-signin

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