请注意:这是NOT我按照以下步骤复制了一份SO https://stackoverflow.com/questions/65184355/error-403-access-denied-from-google-authentication-web-api-despite-google-acc仅通过创建一个新项目来验证答案,但它不起作用。我的情况也是来自开发控制台的 chrome 扩展或 chrome 应用程序客户端 ID。
Error:
错误 403:访问被拒绝
开发者尚未授予您访问此应用程序的权限。目前正在测试中,尚未经过谷歌验证。如果您认为您应该有权访问,请联系开发人员
尽管如此,就像其他帖子一样,我是从所有者帐户访问它的。同时,由于我的声誉不够高,我无法对该帖子的答案发表评论。
尽管如此,
我正在尝试通过以下方式从用户检索访问令牌:
清单.json:
{
"manifest_version": 2,
"name": "To be named",
"description": "This extension helps...",
"version": "0.1.0",
"browser_action":{
"default_popup":"popup.html"
},
"permissions": [
"storage",
"identity",
"identity.email",
"http://127.0.0.1:5000/Time"
],
"oauth2":{
"client_id":"10977...esr6.apps.googleusercontent.com",
"scopes":["https://www.googleapis.com/auth/userinfo.profile"]
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_scripts": [{
"matches": ["https://www.blank.org/"],
"js": ["content.js"],
"css": ["styles.css"]
}]
}
背景.js:
chrome.identity.getAuthToken({ 'interactive': true }, function(token) {
if (token){alert('token is ' + token)}
else{alert('token not present')}
});
P.S:我不想通过验证路线,因为我正处于测试阶段。另外,我希望业主不需要进行验证。