Open wanek21 opened 1 month ago
@wanek21 So here's what I found so far:
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.
You can check this one too: https://stackoverflow.com/questions/78911767/android-kotlin-google-credential-manager-get-access-token
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!