Firebase Google SignIn 在 Android 上经过几次登录后不起作用。

huangapple go评论111阅读模式
英文:

Firebase Google SignIn not working after few login Android

问题

I am using firebase Google SignIn Authentication, App is working fine initially but after a few tries, login is not successful. Is there any way to test Google auth in debug mode? I tried to put AndroidDebug SHA key, but it's not working!
Getting this error.

[BeginSignInOperation] BeginSignInOperation failed. [CONTEXT service_id=212 ]
czxt: asco
at asgj.apply(:com.google.android.gms@232316037@23.23.16 (150400-540660214):5)
at cztd.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):2)
at czte.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):10)
at acav.c(:com.google.android.gms@232316037@23.23.16 (150400-540660214):6)
at acav.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at acgd.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at java.lang.Thread.run(Thread.java:923)
Caused by: asco
at ascn.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at asco.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at mnv.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):85)
at asgh.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at cztw.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):2)
at czty.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):9)

I am using:

Google Play service auth

com.google.android.gms:play-services-auth:20.5.0

Firebase Auth

com.google.firebase:firebase-auth-ktx:21.0.3

I followed this example:
https://firebase.google.com/docs/auth/android/google-signin

This is how I provide an object for SignIn and signUp:

@Provides
@Named(SIGN_IN_REQUEST)
fun provideSignInRequest(
app: Application
) = BeginSignInRequest.builder()
.setGoogleIdTokenRequestOptions(
BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
.setSupported(true)
.setServerClientId(app.getString(R.string.default_web_client_id))
.setFilterByAuthorizedAccounts(false)
.build()
)
.setAutoSelectEnabled(false)
.build()

@Provides
@Named(SIGN_UP_REQUEST)
fun provideSignUpRequest(
app: Application
) = BeginSignInRequest.builder()
.setGoogleIdTokenRequestOptions(
BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
.setSupported(true)
.setServerClientId(app.getString(R.string.default_web_client_id))
.setFilterByAuthorizedAccounts(false)
.build()
)
.build()

Here I am calling in my repo:

override suspend fun oneTapSignInWithGoogle(): OneTapSignInResponse {
return try {
val signInResult = oneTapClient.beginSignIn(signInRequest).await()
Response.Success(signInResult)
} catch (e: Exception) {
try {
val signUpResult = oneTapClient.beginSignIn(signUpRequest).await()
Response.Success(signUpResult)
} catch (e: Exception) {
Response.Failure(e)
}
}
}

英文:

I am using firebase Google SignIn Authentication, App is working fine initially but after few try , login is not getting any success , is there any way to test google auth in debug mode, I tried to put AndroidDebug SHA key but its not working !
Getting this error.

[BeginSignInOperation] BeginSignInOperation failed. [CONTEXT service_id=212 ]
    czxt: asco
    	at asgj.apply(:com.google.android.gms@232316037@23.23.16 (150400-540660214):5)
    	at cztd.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):2)
    	at czte.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):10)
    	at acav.c(:com.google.android.gms@232316037@23.23.16 (150400-540660214):6)
    	at acav.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):7)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    	at acgd.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
    	at java.lang.Thread.run(Thread.java:923)
    Caused by: asco
    	at ascn.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
    	at asco.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
    	at mnv.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):85)
    	at asgh.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
    	at cztw.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):2)
    	at czty.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):9)

I am using

Google Play service auth

com.google.android.gms:play-services-auth:20.5.0

Firebase Auth

com.google.firebase:firebase-auth-ktx:21.0.3

I followed this example
https://firebase.google.com/docs/auth/android/google-signin

This is how I provide object for SignIn and signUp

@Provides
    @Named(SIGN_IN_REQUEST)
    fun provideSignInRequest(
        app: Application
    ) = BeginSignInRequest.builder()
        .setGoogleIdTokenRequestOptions(
            BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
                .setSupported(true)
                .setServerClientId(app.getString(R.string.default_web_client_id))
                .setFilterByAuthorizedAccounts(false)
                .build()
        )
        .setAutoSelectEnabled(false)
        .build()

    @Provides
    @Named(SIGN_UP_REQUEST)
    fun provideSignUpRequest(
        app: Application
    ) = BeginSignInRequest.builder()
        .setGoogleIdTokenRequestOptions(
            BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
                .setSupported(true)
                .setServerClientId(app.getString(R.string.default_web_client_id))
                .setFilterByAuthorizedAccounts(false)
                .build()
        )
        .build()

Here I am calling in my repo

override suspend fun oneTapSignInWithGoogle(): OneTapSignInResponse {
        return try {
            val signInResult = oneTapClient.beginSignIn(signInRequest).await()
            Response.Success(signInResult)
        } catch (e: Exception) {
            try {
                val signUpResult = oneTapClient.beginSignIn(signUpRequest).await()
                Response.Success(signUpResult)
            } catch (e: Exception) {
                Response.Failure(e)
            }
        }
    }

答案1

得分: 1

Are you using a phone identification? For some of the authentication methods you need to identify the testing accounts or else it will block them to avoid spams. On top of that, there is a max quota for free accounts per day (for SMS it's 50).

英文:

Are you using a phone identification? For some of the authentication methods you need to identify the testing accounts or else it will block them to avoid spams. On top of that, there is a max quota for free accounts per day (for SMS it's 50)

Firebase Google SignIn 在 Android 上经过几次登录后不起作用。

huangapple
  • 本文由 发表于 2023年6月27日 17:27:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76563458.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定