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

Google sign in - silentSignIn is failing (SIGN_IN_REQUIRED / INTERNAL_ERROR) #563

Open
eloisance opened this issue Nov 14, 2022 · 1 comment

Comments

@eloisance
Copy link

Describe your environment

  • Device: Multiples (Samsung, Google, Huawei, Xiaomi...)
  • OS version: Multiples (12, 11, 10, 9..)
  • SDK version: 33
  • [Android] Google Play Services version: 20.2.0

Describe the problem:

Steps to reproduce:

Couldn't reproduce.

Observed Results:

For some of our users, the silentSignIn method is failing with the error code SIGN_IN_REQUIRED or INTERNAL_ERROR during our auto-login process when starting the app (Splash screen), hence we are not able to send to our backend a valid token.

This past month we had 2k of SIGN_IN_REQUIRED and 3k of INTERNAL_ERROR non-fatals coming from our production users. So far we are not able to reproduce it, neither understand in which scenario it can happen.

Screenshot 2022-11-14 at 15 29 02

Expected Results:

To always received the idToken, existing one if still valid or a new one if expired.

Relevant Code:

How we are trying to get a fresh token during the auto-login process :

val googleSignOptions: GoogleSignInOptions = Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
        .requestIdToken(serverClientId)
        .requestEmail()
        .build()
val googleSignInClient = GoogleSignIn.getClient(safeActivity, googleSignInOptions)
googleSignInClient.silentSignIn().addOnCompleteListener { task ->
    try {
        val account: GoogleSignInAccount? = task.getResult(ApiException::class.java)
        account?.idToken?.let { idToken ->
            // return success with the idToken
        }
    } catch (exception: ApiException) {
        // return the exception
    }
}

This is affecting badly the user experience as those users needs to sign-in again inside the app.
Can you share which workflow we should use to improve this experience for our end users ?

Thanks

@nandha2907
Copy link

@eloisance Did you find any solution for this? facing same issue.

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

2 participants