【发布时间】:2013-06-18 21:32:06
【问题描述】:
我正在尝试将 OAuth 与我的 chrome 扩展程序集成。我正在关注谷歌的教程:https://developer.chrome.com/extensions/tut_oauth.html
我从 background.js(由我定义并由 background.html 加载)创建 ExOauth。
var oauth = ChromeExOAuth.initBackgroundPage({
'request_url': 'https://www.google.com/accounts/OAuthGetRequestToken',
'authorize_url': 'https://www.google.com/accounts/OAuthAuthorizeToken',
'access_url': 'https://www.google.com/accounts/OAuthGetAccessToken',
'consumer_key': 'anonymous',
'consumer_secret': 'anonymous',
'scope': 'https://docs.google.com/feeds/',
'app_name': Test app'
});
oauth.authorize(onAuthorized);
这是 OnAuthorized 方法:
onAuthorized = function () {
// Start my application logic.
};
我在这里遗漏了什么吗?当我加载扩展程序时,它会打开几个“重定向....”选项卡。
【问题讨论】:
-
我仍然有这个问题,它不断打开新标签。你是怎么解决的?
标签: oauth google-chrome-extension