无法通过Firebase身份验证进行身份验证-Android Studio

时间:2020-06-05 17:15:16

标签: android firebase firebase-authentication

当用户尝试在Firebase身份验证上进行身份验证时,出现此错误。 我只是在其他笔记本电脑上的应用程序中更改了一些图形元素,并且身份验证不再起作用。

以下是输出:

2020-06-05 18:57:22.145 9756-10052/com.energer.freestylegame E/FirebaseInstanceId: Failed to get FIS auth token
    java.util.concurrent.ExecutionException: javax.net.ssl.SSLPeerUnverifiedException: Hostname firebaseinstallations.googleapis.com not verified:
        certificate: sha1/UvjhYyrmSGK9qTUV0GTYYqdhZRs=
        DN: CN=wireless.wifirst.net,OU=Gandi Standard SSL,OU=Domain Control Validated
        subjectAltNames: [wireless.wifirst.net, www.wireless.wifirst.net]
        at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
        at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
        at com.google.firebase.iid.zzt.zzb(com.google.firebase:firebase-iid@@20.1.5:54)
        at com.google.firebase.iid.zzt.zza(com.google.firebase:firebase-iid@@20.1.5:72)
        at com.google.firebase.iid.zzs.run(Unknown Source:12)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: javax.net.ssl.SSLPeerUnverifiedException: Hostname firebaseinstallations.googleapis.com not verified:
        certificate: sha1/UvjhYyrmSGK9qTUV0GTYYqdhZRs=
        DN: CN=wireless.wifirst.net,OU=Gandi Standard SSL,OU=Domain Control Validated
        subjectAltNames: [wireless.wifirst.net, www.wireless.wifirst.net]
        at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:201)
        at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:149)
        at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
        at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
        at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
        at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
        at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.writeFIDCreateRequestBodyToOutputStream(com.google.firebase:firebase-installations@@16.2.1:180)
        at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(com.google.firebase:firebase-installations@@16.2.1:154)
        at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(com.google.firebase:firebase-installations@@16.2.1:433)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCall(com.google.firebase:firebase-installations@@16.2.1:333)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationInternal$0(com.google.firebase:firebase-installations@@16.2.1:323)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$5.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
            ... 1 more
2020-06-05 18:57:22.260 9756-9802/com.energer.freestylegame W/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
2020-06-05 18:57:23.881 9756-10047/com.energer.freestylegame D/FA: Application going to the background
2020-06-05 18:57:29.137 9756-10047/com.energer.freestylegame V/FA: Inactivity, disconnecting from the service
2020-06-05 18:57:52.485 9756-10108/com.energer.freestylegame E/FirebaseInstanceId: Failed to get FIS auth token
    java.util.concurrent.ExecutionException: javax.net.ssl.SSLPeerUnverifiedException: Hostname firebaseinstallations.googleapis.com not verified:
        certificate: sha1/UvjhYyrmSGK9qTUV0GTYYqdhZRs=
        DN: CN=wireless.wifirst.net,OU=Gandi Standard SSL,OU=Domain Control Validated
        subjectAltNames: [wireless.wifirst.net, www.wireless.wifirst.net]
        at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
        at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
        at com.google.firebase.iid.zzt.zzb(com.google.firebase:firebase-iid@@20.1.5:54)
        at com.google.firebase.iid.zzt.zza(com.google.firebase:firebase-iid@@20.1.5:72)
        at com.google.firebase.iid.zzs.run(Unknown Source:12)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: javax.net.ssl.SSLPeerUnverifiedException: Hostname firebaseinstallations.googleapis.com not verified:
        certificate: sha1/UvjhYyrmSGK9qTUV0GTYYqdhZRs=
        DN: CN=wireless.wifirst.net,OU=Gandi Standard SSL,OU=Domain Control Validated
        subjectAltNames: [wireless.wifirst.net, www.wireless.wifirst.net]
        at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:201)
        at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:149)
        at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
        at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
        at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
        at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
        at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.writeFIDCreateRequestBodyToOutputStream(com.google.firebase:firebase-installations@@16.2.1:180)
        at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(com.google.firebase:firebase-installations@@16.2.1:154)
        at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(com.google.firebase:firebase-installations@@16.2.1:433)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCall(com.google.firebase:firebase-installations@@16.2.1:333)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationInternal$0(com.google.firebase:firebase-installations@@16.2.1:323)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$5.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
            ... 1 more
2020-06-05 18:57:52.591 9756-9802/com.energer.freestylegame W/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
2020-06-05 18:58:52.809 9756-10390/com.energer.freestylegame E/FirebaseInstanceId: Failed to get FIS auth token
    java.util.concurrent.ExecutionException: javax.net.ssl.SSLPeerUnverifiedException: Hostname firebaseinstallations.googleapis.com not verified:
        certificate: sha1/UvjhYyrmSGK9qTUV0GTYYqdhZRs=
        DN: CN=wireless.wifirst.net,OU=Gandi Standard SSL,OU=Domain Control Validated
        subjectAltNames: [wireless.wifirst.net, www.wireless.wifirst.net]
        at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
        at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
        at com.google.firebase.iid.zzt.zzb(com.google.firebase:firebase-iid@@20.1.5:54)
        at com.google.firebase.iid.zzt.zza(com.google.firebase:firebase-iid@@20.1.5:72)
        at com.google.firebase.iid.zzs.run(Unknown Source:12)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: javax.net.ssl.SSLPeerUnverifiedException: Hostname firebaseinstallations.googleapis.com not verified:
        certificate: sha1/UvjhYyrmSGK9qTUV0GTYYqdhZRs=
        DN: CN=wireless.wifirst.net,OU=Gandi Standard SSL,OU=Domain Control Validated
        subjectAltNames: [wireless.wifirst.net, www.wireless.wifirst.net]
        at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:201)
        at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:149)
        at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
        at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
        at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
        at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
        at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.writeFIDCreateRequestBodyToOutputStream(com.google.firebase:firebase-installations@@16.2.1:180)
        at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(com.google.firebase:firebase-installations@@16.2.1:154)
        at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(com.google.firebase:firebase-installations@@16.2.1:433)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCall(com.google.firebase:firebase-installations@@16.2.1:333)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationInternal$0(com.google.firebase:firebase-installations@@16.2.1:323)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$5.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
            ... 1 more

当应用启动时,我在这里调用auth方法:

import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.auth.FirebaseAuth;

public class SplashScreen extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        SharedPreferences user=this.getSharedPreferences("user",MODE_PRIVATE);

        if(FirebaseAuth.getInstance().getCurrentUser()==null){
            startActivity(new Intent(this,PresentationActivity.class));
        }else {
            startActivity(new Intent(this,MainActivity.class));
        }
        finish();
    }
}

我已经确认我的sha-1是否正确。

非常感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

这是我的临时解决方案,从实现“ com.google.firebase:firebase-messaging:20.1.3”降级到implementation 'com.google.firebase:firebase-messaging:20.1.0'

我仍在寻找永久居民。找到它后,请分享您的解决方案。 我相信永久的将是手动配置Firebase参数,如下所示:

    // Manually configure Firebase Options. The following fields are REQUIRED:
//   - Project ID
//   - App ID
//   - API Key
FirebaseOptions options = new FirebaseOptions.Builder()
        .setProjectId("my-firebase-project")
        .setApplicationId("1:27992087142:android:ce3b6448250083d1")
        .setApiKey("AIzaSyADUe90ULnQDuGShD9W23RDP0xmeDc6Mvw")
        // setDatabaseURL(...)
        // setStorageBucket(...)
        .build();

here所述,但是我没有成功实现它。