使用 JavaScript 问题使用 LinkedIn API 进行身份验证

Authenticate with LinkedIn api using javascript issues

本文关键字:API 身份验证 LinkedIn JavaScript 问题 使用      更新时间:2023-09-26

使用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 Domain:
  4. 保存更改。