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
Sometimes, I can't retrieve the email from googleTokenId on my backend (explained here) so I need to send an additional request with the accessToken on the backend. The issue is that onGoogleSignInResult returns a null accessToken in the GoogleUser object:
GoogleButtonUiContainer(onGoogleSignInResult = { googleUser ->
if (googleUser != null) {
val idToken = googleUser.idToken
println("id token: $idToken")
println("access token: ${googleUser.accessToken}") // this is always null
}
}) {}
I checked the source code and found this lines (source):
So, the accessToken is always null. Perhaps I'm looking in the wrong place, and there’s another way to obtain the accessToken. Could you take a look at this, please?
P.S.: Thanks for the great library!
The text was updated successfully, but these errors were encountered:
in ios side Google Sign in returns accessToken directly. But in android, looks like it doesn't provide accessToken directly, it provides idToken, which then you can use in the server side to get email. But as you pointed out sometimes this doesn't work.
What I found so far that, instead of using Google One Tap Sign in, we can use Google Legacy Sign in, and using requestServerAuthCode() would return serverAuthCode which can be changed in the server side with accessToken. Not sure exact details however.
Do you have any example code that you used in android side (not KMP) for solving this?
Sometimes, I can't retrieve the email from googleTokenId on my backend (explained here) so I need to send an additional request with the accessToken on the backend. The issue is that onGoogleSignInResult returns a null accessToken in the GoogleUser object:
I checked the source code and found this lines (source):
So, the accessToken is always null. Perhaps I'm looking in the wrong place, and there’s another way to obtain the accessToken. Could you take a look at this, please?
P.S.: Thanks for the great library!
The text was updated successfully, but these errors were encountered: