-1

I am trying to do a Yahoo oAuth using 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?

I have also https://auth-server.herokuapp.com/ to add as a proxy. What field value should go in it? Also what does domain and reference stand for?

halfer
  • 19,824
  • 17
  • 99
  • 186
Siddharth
  • 545
  • 2
  • 7
  • 24
  • 1
    Drew gave you an answer below, was it of any use? It is usual here to upvote and/or accept answers that are useful, so helpers get a little bit of encouragement to carry on helping. Let me know if you would like to know how to do that. – halfer Nov 02 '15 at 21:29
  • Downvoted, see above. – halfer Nov 28 '15 at 10:24

1 Answers1

2
  • client_id should be the consumer_key in OAuth1.
  • domain should be staging.name.com in your case
  • reference is an arbitary value, i.e. "Local Yahoo"

Your value for redirect_uri should be a full URI (i.e. http://staging.name.com/redirect.html. Or a relative path.

Drew
  • 1,420
  • 1
  • 11
  • 14