How to get idToken from expo-auth-session Google.useAuthRequest() ?

expo-auth-session Google.useAuthRequest() returns google’s idToken value as undefined.

request:

 const [request, response, promptAsync] = Google.useAuthRequest({
    expoClientId: 'GOOGLE_GUID.apps.googleusercontent.com',
    androidClientId:  'GOOGLE_GUID.apps.googleusercontent.com',
  })

response:

"authentication": TokenResponse {
    "accessToken": "received correct access token",
    "expiresIn": "3599",
    **"idToken": undefined,**
    "issuedAt": 1614595369,
    "refreshToken": undefined,
    "scope": "email profile https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email openid",
    "tokenType": "Bearer",
  },

Is there a way to retrieve the idToken from Google ?

@dorapax, try changing your useAuthRequest by useIdTokenAuthRequest… It worked for me!

I tried below and it worked for me.

const [requestIdToken, responseIdToken, promptAsyncIdToken] =
    Google.useAuthRequest({
      **responseType: 'id_token',**
      androidClientId: GOOGLE_CLIENT_ID_ANDROID,
      iosClientId: GOOGLE_CLIENT_ID_IOS,
      expoClientId: GOOGLE_CLIENT_WEB_EXPO,
      scopes: ['profile', 'email'],
    })

@luiz.lemberg are you using firebase for authentication ? As far as I know useIdTokenAuthRequest is working only for firebase.

@dorapax, no, i’m not using firebase for authentication, I’ve just setup my API credentials on google developer console