【问题标题】:hello.js Yahoo API Integrationhello.js 雅虎 API 集成
【发布时间】:2015-11-03 05:28:09
【问题描述】:

我正在尝试使用 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/ 可以添加为代理。应该在其中输入什么字段值?另外,域和引用代表什么?

【问题讨论】:

  • 德鲁在下面给了你一个答案,有用吗?通常在这里投票和/或接受有用的答案,因此帮助者会得到一点鼓励以继续提供帮助。如果您想知道该怎么做,请告诉我。
  • 投反对票,见上文。

标签: javascript html oauth yahoo hello.js


【解决方案1】:
  • client_id 应该是 OAuth1 中的 consumer_key。
  • domain 在你的情况下应该是 staging.name.com
  • reference 是一个任意值,即“本地雅虎”

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-22
    • 2011-11-21
    • 2012-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-27
    • 1970-01-01
    相关资源
    最近更新 更多