jos*_*ras 11 android google-api google-authentication firebase firebase-authentication
我在我的应用中通过Firebase使用Google登录.但是在Play商店中运行已发布的应用时,会显示以下错误.
E/TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE
Run Code Online (Sandbox Code Playgroud)
尽管我已经在Firebase和API控制台上注册了JSON文件中提到的ID.以下是JSON文件代码
{
"project_info": {
"project_number": "311816357497",
"firebase_url": "https://mcqsce.firebaseio.com",
"project_id": "mcqsce",
"storage_bucket": "mcqsce.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:311816357497:android:494b736XXXX6010b",
"android_client_info": {
"package_name": "in.readhere.mcqceit"
}
},
"oauth_client": [
{
"client_id": "311816357497-9ma34c4qXXXXXXXXXXXXXoep8b24u8g.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "in.readhere.mcqceit",
"certificate_hash": "6847ce9f7e38dc588d12345678f21c13bd25ea7c"
}
},
{
"client_id": "311816357497-5lbqnmj0bxxxxxxxxxxxxxm4qjfhmq06.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyC6BGtRfxxxxxxxxxGrwwe_0V3uY9g-0dI"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "311816357497-5lbqnmj0bxxxxxxxxxxxxxxm4qjfhmq06.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
Run Code Online (Sandbox Code Playgroud)
以下是app firebase控制台的API 控制台
小智 46
花了一些时间后,我弄清楚Google登录的问题是什么以及为什么当我登录Google时出现此错误.
因此,这里是该解决方案:在我的情况,我发表了关于谷歌Play商店的APK,我选择了谷歌Play应用签约,做它将为安全起见,以及旧的密钥库得到无效的(新证书密钥库什么的https: //support.google.com/googleplay/android-developer/answer/7384423)您已在firebase中为旧密钥库添加了SHA1,而不是由Google创建的新密钥库.因此,当您尝试通过谷歌登录时,它会抛出此错误.
我想通了:转到您的Google Play控制台(https://play.google.com/apps/publish/)>选择应用程序(在左侧菜单中)>发布管理>应用程序签名
您将看到两个应用程序签名证书,一个是您上传的密钥库证书,另一个是由Google Play创建的新创建的应用程序签名证书.所以,从复制应用程序签名证书的SHA1和SHA256键并粘贴在火力地堡控制台相同的密钥(https://console.firebase.google.com)>选择您的项目>选择应用程序设置>常规(选择您的应用程序包)>和粘贴SHA1和SHA256键并保存,您就完成了.
重新启动应用程序,它将工作.它适用于我的情况;)
您需要在项目设置中为每个 Android 应用添加 SHA 指纹。对于 Firebase,请使用您的项目名称编辑以下链接,然后为您的应用添加指纹。
https://console.firebase.google.com/project/{YOUR_PROJECT_NAME}/settings/general/
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10725 次 |
| 最近记录: |