IdToken always null

See original GitHub issue

After calling:

GoogleSignin.configure({
    webClientId: '<My-Client-Id>'
    offlineAccess: true
})

I then call GoogleSignin.signIn() and the user returned here always has a null IdToken. I have made sure the the webClientId is the same as on the console (as per below screenshot), and matches up with whats in my google-services.json.

The other data is there (even a serverAuthCode), but not the IdToken. What am I doing wrong?

image

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9

github_iconTop GitHub Comments

15reactions
r0b0t3dcommented, Oct 14, 2019

For firebase project, when you enable google auth, there is field Web client ID under Web SDK configuration. Just copy that id to webClientId inside your configure() method

13reactions
Lloydzacommented, Aug 16, 2016

For those of you who have the same issue as me I managed to figure this out.

Setting offlineAccess to true provides you with the serverAuthCode to use server-side, but no longer returns the idToken. If you wish to retrieve the idToken, do not set the offlineAccess in configure (It defaults to false).

This is not mentioned in the docs so I am unsure if this is intended bevahior or a bug?

TLDR: remove the offlineAccess setting from the configure call to get the idToken.

Read more comments on GitHub >

github_iconTop Results From Across the Web

idToken is Null GoogleSignin.getTokens() · Issue #836 - GitHub
Hi, I am getting null for idToken from const userInfo = await GoogleSignin.signIn(); const getToken = await GoogleSignin.
Read more >
Getting idToken 'null' when using google_sign_in in Flutter
I need to send idToken to backend server to verify a user. But IdToken is null from google sign in response. code is...
Read more >
authResult return idToken as Null - Auth0 Community
It seems that you're missing the proper scope for an OpenID Connect request. Add scopes like openid profile email and also the response_type ......
Read more >
Access token is always null in azure ad B2C signin response
On sign in, I always get only id token and access token is always null. I tried passing "openid offline_access" along with my...
Read more >
Getting idToken 'null' when using google_sign_in in Flutter ...
[Solved]-Getting idToken 'null' when using google_sign_in in Flutter-Flutter ... I faced with this Problem for two days and finally. (in my case) this...
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