hello.js雅虎API集成

hello.js Yahoo API Integration

本文关键字:集成 API 雅虎 js hello      更新时间:2023-09-26

我正在尝试使用hello.js进行Yahoo oAuth。请找到我写的代码:

window.onload = function()
{
hello.init(
{
   // "yahoo" : "M0FZ5t7i"
    "yahoo" : "dj0yJmk9WGJDUHpwMkxBNUxEJmQ9WVdrOU4xcFBZVUo1TldrbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1jMw--"
},
{
  redirect_uri:'staging.name.com',
  oauth_proxy: "https://auth-server.herokuapp.com/proxy"
  //https://auth-server.herokuapp.com/   https://auth-server.herokuapp.com/proxy
});
}

点击我添加的按钮:

 hello("yahoo").login().then(function()
    {
        // Get Profile
        return hello("yahoo").api('me');
    }).then(function(p)
    {
      console.log(p.name);
    }).then(null, function(e){
        console.error(e);
        alert(e);
    });

我收到的凭据无效。另外,我的问题是在client_id中,我应该使用什么消费者密钥或Appid?

我也有https://auth-server.herokuapp.com/添加为代理。其中应该包含哪些字段值?域和引用代表什么?

  • client_id应该是OAuth1中的consumer_key
  • 在您的情况下,domain应为staging.name.com
  • reference是一个任意值,即"本地雅虎"

redirect_uri的值应该是一个完整的URI(即http://staging.name.com/redirect.html。或一个相对路径。