Webextension OAuth2返回认证错误

时间:2017-03-22 19:38:48

标签: javascript api oauth-2.0 firefox-webextensions

我正在尝试将OAuth2与Firefox Webextensions(运行在最新的开发人员版本上)用于Trakt.TV API。我单击扩展名,Trakt.TV的OAuth2顶点打开,但当我重定向回webextensions的HTML时,此错误显示在浏览器中(从母语翻译)

错误:

{RedirectURL}.extensions.allizom.org:443 uses an invalid safetycerificate. This certificate is only valid for the following names: *.allizom.org, allizom.org
<a id="errorCode" title="SSL_ERROR_BAD_CERT_DOMAIN">SSL_ERROR_BAD_CERT_DOMAIN<‌​/a>

JS:

function fetchOAuth2()
{
   var redirectURL = browser.identity.getRedirectURL() + "DisplayAnime.html";
   var clientID = "ID";  
   var authURL = "https://trakt.tv/oauth/authorize";
   authURL += `?response_type=code`;
   authURL += `&client_id=${clientID}`;
   authURL += `&redirect_uri=${redirectURL}`;
   console.log(authURL);
   return browser.identity.launchWebAuthFlow({
       interactive: true,
       url: authURL
   });

的manifest.json:

{
    "manifest_version": 2,
    "name": "KissaniTrakt",

    "version": "1.0",

    "description": "An \"I watched this!\" button on Kissanime, for Trakt.TV",

  "permissions": [
    "tabs",
    "identity"
  ],

  "browser_action": {
     "default_title": "KissaniTrakt",
     "default_popup": "DisplayAnime.html"
  }
}

这个函数应该返回一个代码,然后我可以通过JSON到Trakt.TV服务器获取验证码。但事实并非如此,因为错误中提到的错误。

0 个答案:

没有答案