Max*_*s S 8 google-chrome google-chrome-app
我在用户点击sign inChrome应用中的按钮时对用户进行身份验证.这会在Chrome中打开一个新页面,提示他们使用自己的Google帐户登录.然后,弹出窗口打开,询问我的应用程序请求的权限.当他们点击确定,应用程序收到token- 它一切正常,直到我切换到不同的区域设置.
当我测试在韩国语言环境的应用程序,token是不确定的一个成功标志后,我进一步调查,我发现我的错误chrome.runtime.identity.getAuthToken: Authorization page could not be loaded.
extensions::lastError:133 Unchecked runtime.lastError while running identity.getAuthToken: Authorization page could not be loaded.
at chrome-extension://APP_ID/foreground/bundle/app.js:29630:24
at chrome-extension://APP_ID/foreground/bundle/app.js:28068:46
at Object.loadUserPlaylists (chrome-extension://APP_ID/foreground/bundle/app.js:27679:13)
at SidebarPlaylists.onSignInAndLoadUserPlaylists (chrome-extension://APP_ID/foreground/bundle/app.js:42014:19)
at Object.invokeGuardedCallback (chrome-extension://APP_ID/foreground/bundle/app.js:11872:13)
at executeDispatch (chrome-extension://APP_ID/foreground/bundle/app.js:11717:22)
at Object.executeDispatchesInOrder (chrome-extension://APP_ID/foreground/bundle/app.js:11737:8)
Run Code Online (Sandbox Code Playgroud)
这可以防止任何在韩国的用户登录并使用我的Chrome应用.为什么会发生这种情况,我该如何解决?
更新:
添加以下权限不起作用:
"https://*.chromiumapp.org/*", "https://chromiumapp.org/",
"https://*.apps.googleusercontent.com/", "https://apps.googleusercontent.com/",
"https://apps.googleusercontent.com/", "https://apps.googleusercontent.com/",
"https://*.chromiumapp.org/*/*"
Run Code Online (Sandbox Code Playgroud)
UPDATE2:
我尝试使用launchWebAuthFlow()而不是identity.getAuthToken().
chrome.identity.launchWebAuthFlow({
url: "https://accounts.google.com/o/oauth2/v2/auth?scope=email&response_type=token&client_id=MY_CLIENT_ID&redirect_uri="+chrome.identity.getRedirectURL()+"&prompt=consent",
interactive: true
}, function(respUrl) {
//respUrl is empty
debugger;
//getUserPlaylists(token, dispatch);
Run Code Online (Sandbox Code Playgroud)
这也给了我
extensions::lastError:133 Unchecked runtime.lastError while running identity.launchWebAuthFlow: Authorization page could not be loaded.
错误.
| 归档时间: |
|
| 查看次数: |
1225 次 |
| 最近记录: |