简体   繁体   English

hello.js Yahoo API集成

[英]hello.js Yahoo API Integration

I am trying to do a Yahoo oAuth using hello.js . 我正在尝试使用hello.js进行Yahoo hello.js Please find my code that I have written: 请找到我编写的代码:

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
});

}

and on click of a button I have added: 并单击按钮添加:

 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);
    });

I am getting invalid credential. 我的凭证无效。 Also my question is in client_id , what should I use consumer key or Appid? 我的问题也在client_id ,我应该使用使用者密钥或Appid?

I have also https://auth-server.herokuapp.com/ to add as a proxy. 我也有https://auth-server.herokuapp.com/要添加为代理。 What field value should go in it? 应该在其中输入什么字段值? Also what does domain and reference stand for? 域和引用也代表什么?

  • client_id should be the consumer_key in OAuth1. client_id应该是OAuth1中的consumer_key。
  • domain should be staging.name.com in your case domain应为staging.name.com
  • reference is an arbitary value, ie "Local Yahoo" reference是一个任意值,即“本地Yahoo”

Your value for redirect_uri should be a full URI (ie http://staging.name.com/redirect.html . Or a relative path. 您的redirect_uri值应为完整URI(即http://staging.name.com/redirect.html 。或相对路径)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM