Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login issue on Android #1318

Closed
samuelepozzebon opened this issue May 1, 2024 · 5 comments
Closed

Login issue on Android #1318

samuelepozzebon opened this issue May 1, 2024 · 5 comments

Comments

@samuelepozzebon
Copy link
Contributor

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 the Authentication.signIn (line 37) because the value that is currently being provided is the id (the email), instead of the idToken.
Because of this the Firebase authentication fails.
Either using the idToken instead of the id or changing the order of the clauses in the when fixed the issue.

@martinbonnin
Copy link
Collaborator

Good catch! Want to open a pull request?

@samuelepozzebon
Copy link
Contributor Author

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.

@martinbonnin
Copy link
Collaborator

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.

@yschimke
Copy link
Collaborator

yschimke commented May 2, 2024

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.

@joreilly
Copy link
Owner

Think we can close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants