You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refresh id token periodically, same as access token #1614
To do that we can use Google's library that uses GoogleSignInClient#silentSignIn() to fetch the latest version of SignIn data(that contains idToken) without a user action(silently). If silentSignIn() will fail we can ask a user to re-authenticate.
That what I said means we don't need to find out how to refresh idToken manually. The library does it for us. I think we can close it.
After adding the last changes I started to test the whole process. It seems that fetching the last idToken on Android has interesting behavior. The Android library can return expired idToken but after a few attempts the library returns an updated idToken. I have to reinvestigate this issue.
Activity
DenBond7 commentedon Dec 20, 2021
https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInClient#silentSignIn()
https://gist.github.com/glcoder/c2783ad8c99063fc12250b9e32620751
https://stackoverflow.com/questions/38737021/how-to-refresh-id-token-after-it-expires-when-integrating-google-sign-in-on-andr
DenBond7 commentedon Dec 20, 2021
To do that we can use Google's library that uses
GoogleSignInClient#silentSignIn()to fetch the latest version of SignIn data(that containsidToken) without a user action(silently). IfsilentSignIn()will fail we can ask a user to re-authenticate.That what I said means we don't need to find out how to refresh
idTokenmanually. The library does it for us. I think we can close it.tomholub commentedon Dec 20, 2021
Should also save the id token in memory each time we renew it. Else you'll have to get a fresh new token each time, I'm not sure if that's good.
Unless google library caches it for you.
DenBond7 commentedon Dec 20, 2021
Yes, it caches that data
tomholub commentedon Dec 20, 2021
ok to close in that case
DenBond7 commentedon Jan 24, 2022
After adding the last changes I started to test the whole process. It seems that fetching the last
idTokenon Android has interesting behavior. The Android library can return expiredidTokenbut after a few attempts the library returns an updatedidToken. I have to reinvestigate this issue.Added a retry strategy to get idToken.| #1614
Added a retry strategy to get idToken.| #1614 (#1663)