javascript - 使用 javascript 问题通过 LinkedIn api 进行身份验证

标签 javascript linkedin-jsapi

使用 Linkedin 教程,我尝试使用 Javascript 登录 LinkedIn。

我遇到的问题:使用 firebug 进行验证我意识到 http 请求没有显示错误,但是 LinkedIn 按钮没有呈现并且 http 响应是:

(function(){
var r=("true" === "false"), a=("false" === "false"), h=[], e=("false" === "true");
var p="${SCOPE_NAME}";
var s=("SCOPE_VALID" === "SCOPE_INVALID"), n=("SCOPE_VALID" === "SCOPE_NOT_AUTHORIZED"),
d=("SCOPE_VALID" === "SCOPE_DISABLED");

if(e){
    throw new Error("An error occurred.");
}
else if (!a) {  
  throw new Error("API Key is invalid");
}
else if (s) {
  throw new Error("Scope parameter is invalid: " + p);
}
else if (n) {
  throw new Error("Scope parameter is not authorized: " + p);
}
else if (d) {
  throw new Error("Scope parameter is disabled: " + p);
}
else if (h.length == 0) {
  throw new Error("You must specify a valid JavaScript API Domain as part of this key's
configuration.");
}
else if (!r) {
  throw new Error("JavaScript API Domain is restricted to "+h.join(", "));
}

else {
  throw new Error("Unknown Error");
}
})();

你能帮我解决这个问题吗?

最佳答案

  1. 转到 https://www.linkedin.com/secure/developer
  2. 点击您正在使用的应用名称。
  3. 添加您的域名(' http://www.example.com ') 或者如果您使用 localhost 然后将 (' http://localhost ') 添加到 JavaScript API 域:
  4. 保存更改。

关于javascript - 使用 javascript 问题通过 LinkedIn api 进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19390606/

相关文章:

javascript - 文本未定义 - JavaScript

javascript - 如何在 1 个输入类型中调用 2 个函数

c# - LinkedIn OAuth 失败并显示 https_required 错误消息

rest - 使用 LinkedIn JSAPI 凭据 cookie 对用户进行身份验证

javascript - Cordova Angular 获取 Web Api 连接被拒绝

javascript - linq,js GroupBy 坐标(lat, lng)

javascript - LinkedIn 关注按钮 Google Chrome 内容安全策略 script-src 报告样本

javascript - 领英 API : Looking for the most effective way to search a large list of people

javascript - linkedin api 奇怪的空响应

javascript - jQuery 不能使用 addClass