Open samuelepozzebon opened 2 weeks ago
Good catch! Want to open a pull request?
My only doubt is which one of the two possibile solution is the correct one, since the tokenId
was removed in favor of the id
in a previous PR and I don't know if it was an error or if it was an actual fix. Logging with my user always matches the first clause in the when
, regardless of which one of the two is set as the first one, so I cannot really test the correctness of either solution.
TBH that other PR wasn't 100% clear to me. Using tokenId
instead of just id
seems a lot more correct. Plus it works on your device so I'd say let's change the first branch and leave the other one untouched. That first branch was probably a mistake from me.
This confirms it should be idToken https://developers.google.com/identity/android-credential-manager/android/reference/com/google/android/libraries/identity/googleid/GoogleIdTokenCredential
But this sounds misleading
https://developer.android.com/training/sign-in/credential-manager
If the conversion succeeds, extract the GoogleIdTokenCredential's ID, validate it, and authenticate the credential on your server.
I cannot login with Google on the current release build of the app. I've done a bit of debugging and the problem seems to be in the
SignIn.kt
file, in the data provided to theAuthentication.signIn
(line 37) because the value that is currently being provided is theid
(the email), instead of theidToken
. Because of this the Firebase authentication fails. Either using theidToken
instead of theid
or changing the order of the clauses in thewhen
fixed the issue.