on-internet
← Community

Migration from GoogleSignIn to Credential Manager. Get 'idToken' silently

Stack Overflow ·

I'm trying to migrate from GoogleSignIn to Credential Manager. GoogleSignIn implementation After authetication, I need to know idToken from time to time to make a request to our server val googleSignInClient = GoogleSignIn.getClient( context, GoogleApiClientHelper.generateGoogleSignInOptions() ) val silentSignIn = googleSignInClient.silentSignIn() if (!silentSignIn.isSuccessful || silentSignIn.result.isExpired) { throw IllegalStateException("Could not receive idToken") } val idToken = silentSignIn.result.idToken put("Authorization", "Bearer $idToken") where GoogleApiClientHelper.generateGoogle

Comments

Sign in or sign up to comment and upvote.

No comments yet.