Dan*_*leh 10 google-api google-chrome-extension google-api-client google-oauth
请注意:这不是重复的,因为我通过创建一个新项目来遵循SO only 经过验证的答案,但它没有用。另外我的情况是来自开发控制台的 chrome 扩展或 chrome 应用程序客户端 ID。
错误:
错误 403:access_denied 开发者未授予您访问此应用的权限。它目前正在测试中,尚未得到 Google 的验证。如果您认为您应该拥有访问权限,请联系开发人员
尽管如此,就像我从所有者帐户访问它的另一篇文章一样。同时,我不能对那个帖子的答案发表评论,因为我的声誉不够高。尽管如此,
我正在尝试通过以下方式从用户检索访问令牌:
清单.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"]
}]
}
Run Code Online (Sandbox Code Playgroud)
背景.js:
chrome.identity.getAuthToken({ 'interactive': true }, function(token) {
if (token){alert('token is ' + token)}
else{alert('token not present')}
});
Run Code Online (Sandbox Code Playgroud)
PS:我在测试阶段,不想走验证路线。此外,我希望所有者不需要验证。
归档时间: |
|
查看次数: |
15188 次 |
最近记录: |