chrome.identity.getAuthToken()失败,OAuth2请求失败:服务响应错误:'错误的客户端ID:<client_ID>

时间:2019-11-14 18:36:47

标签: google-chrome-extension firebase-authentication

我正在编写一个Chrome扩展程序,该扩展程序使用Firebase身份验证登录用户并遵循this quickstart code example。我找不到任何可以解决我确切问题的SO帖子;其他大多数问题报告为“错误的客户ID:{0}或”错误的请求”。当我在manifest.json文件中将client_id设置为chrome ID时,确实得到了“错误的客户ID:{0}”,因此我从Google Developer Console创建了新的凭据,将ID替换为清单并得到了礼物。错误:

"permissions": ["tabs",
"identity",
"activeTab",
"storage",
"https://mail.google.com/mail/*"],
"content_security_policy": "script-src 'self' https://www.gstatic.com/ https://*.firebaseio.com https://www.googleapis.com; object-src 'self'",
"oauth2": {
"client_id": <client_id>",
"scopes": [
  "https://www.googleapis.com/auth/userinfo.email",
  "https://www.googleapis.com/auth/drive",
  "https://www.googleapis.com/auth/userinfo.profile"
]

}

过去三天我一直在为此苦苦挣扎。不确定为什么必须如此困难。

0 个答案:

没有答案