Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome extension 无法在具有identity.getAuthToken的chrome扩展chrome中获取令牌_Google Chrome Extension_Oauth - Fatal编程技术网

Google chrome extension 无法在具有identity.getAuthToken的chrome扩展chrome中获取令牌

Google chrome extension 无法在具有identity.getAuthToken的chrome扩展chrome中获取令牌,google-chrome-extension,oauth,Google Chrome Extension,Oauth,我无法使用获取身份验证令牌 chrome.identity.getAuthToken({interactive: true}, token => { ... } 我得到这个错误: Unchecked runtime.lastError: OAuth2 request failed: Connection failed (-2). 我为ChromeApp设置了OAuth 2.0客户端,并指定了扩展的应用程序id。同时设置一个同意页面。 我的清单如下所示: "permissi

我无法使用获取身份验证令牌

chrome.identity.getAuthToken({interactive: true}, token => {
...
}
我得到这个错误:

Unchecked runtime.lastError: OAuth2 request failed: Connection failed (-2).
我为ChromeApp设置了OAuth 2.0客户端,并指定了扩展的应用程序id。同时设置一个同意页面。 我的清单如下所示:

  "permissions": [
    "storage",
    "identity"
  ],
  "key": "<my application key>",
  "oauth2": {
      "client_id": "<my client id>.apps.googleusercontent.com", 
      "scopes": [
          "openid", "email", "profile"
      ]
  }
“权限”:[
“存储”,
“身份”
],
“密钥”:“密钥”,
“oauth2”:{
“客户端id”:“.apps.googleusercontent.com”,
“范围”:[
“openid”、“电子邮件”、“个人资料”
]
}

如何修复或至少调试此问题?

我也有此问题,我注意到我最初使用的不是Chrome,而是Microsoft Edge


确保您使用的是Chrome。

我也遇到了这个问题,我注意到我最初没有使用Chrome,而是使用了Microsoft Edge


确保您使用的是Chrome。

您必须使用正确的密码:您必须编写
https://www.googleapis.com/auth/userinfo.email
,用于example@IvánNokonoko感谢您的建议,但它也不起作用,同样的错误。您必须使用正确的:而不是
电子邮件
,你必须写
https://www.googleapis.com/auth/userinfo.email
,用于example@IvánNokonoko感谢您的建议,但它也不起作用,同样的错误。