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

ID is empty with GoogleIdTokenCredential via GetSignInWithGoogleOption #98

Open
oiatomic opened this issue Sep 19, 2024 · 1 comment
Open

Comments

@oiatomic
Copy link

oiatomic commented Sep 19, 2024

We already have an android app with a lot of users signed in with Google using the previous google auth,

We migrated to CredentialManager in the last release using version 1.2.2

The google sign in request that we make

val signInWithGoogleIdOption = GetSignInWithGoogleOption
            .Builder(apiKey)
            .build()

        val request: GetCredentialRequest = GetCredentialRequest
            .Builder()
            .addCredentialOption(signInWithGoogleIdOption)
            .build()

For one QA account we always get the email as BLANK inside the Id param of GoogleIdTokenCredential after moving away from legacy/deprecated GoogleSignIn (it worked fine with the previous Google Signin process) For other accounts that we have it's working fine!

  val credentials = handleCredentials(result.credential)
        credentials?.id?.takeIf { it.isEmpty().not() }?.let {
            return credentials
        } ?: throw Exception("Email address was not shared during Google Login!")

so the code always goes into the exception state.

What do you recommend here ? Also this behaviour from Google's is not acceptable since out app is already in release and there is no proper documentation as to why its not working for that user! . 🤕

PS: I had to send a force update to the user just because google wanted me to migrate to credential manager which itself is immature atm ? What do i do ?

@programmerpinggiran
Copy link

programmerpinggiran commented Sep 21, 2024

im also got this problem, code was working fine, until this month
String email = googleIdTokenCredential.getId(); according to documentation here, its should return email. not number

im also post here : https://stackoverflow.com/questions/79009904/android-google-sign-in-with-credential-manager-unable-to-get-user-data-on-retur

the issue has been fixed, thank you https://issuetracker.google.com/issues/368873078

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

3 participants
@programmerpinggiran @oiatomic and others