问题描述
请注意:这不是重复,因为我遵循了 SO only 经过验证的答案,创建了一个新项目,但它不起作用。另外我的情况是来自开发控制台的 chrome 扩展或 chrome 应用程序客户端 ID。
错误:
错误 403:access_denied 开发者尚未授予您访问此应用的权限。它目前正在测试中,尚未得到 Google 的验证。如果您认为自己应该拥有访问权限,请联系开发者
尽管如此,就像我从所有者帐户访问的另一篇文章一样。同时,我不能对那个帖子的答案发表评论,因为我的声誉不够高。 尽管如此,
我正在尝试通过以下方式从用户那里检索访问令牌:
manifest.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"]
}]
}
background.js:
chrome.identity.getAuthToken({ 'interactive': true },function(token) {
if (token){alert('token is ' + token)}
else{alert('token not present')}
});
P.S:我不想走验证路线,因为我处于测试阶段。此外,我希望所有者不需要验证。
解决方法
解决方案:
- 转到您的 developer console。
- 转到 OAuth 同意屏幕。
- 转到 + 添加用户,测试用户。
- 为测试添加用户(甚至 所有者的电子邮件地址,如果没有它就不能工作)