0

Error Unauthorized

Hi there,

I am stuck on this for past 3 days and could not get it to work. angry.gif I could get this through for LinkedIn though. smile.gif

Everytime I try to get the request token I get "Unauthorized" error message. I am not able to figure out why the request is Unauthorized!

Can anybody point me to what exactly is going wrong?

I am doing a POST request and my request body contains these parameters.

oauth_callback%3Dyconnect%253A%252F%252Fsuccess%26oauth_consumer_key%3DmyConsumerKey%26oauth_nonce%3D7815649%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1271401800%26oauth_version%3D1.0%26oauth_signature%3D34lHPl3BVRD66wHARAm9FAOjfyw%253d

just to make it work I tried different combinations and added "POST%26https%3A%2F%2Fapi.login.yahoo.com%2Foauth%2Fv2%2Fget_request_token%26" to the post but still fails.


Lemme know if anyone wants to see the code and i will put it here..

Thanks in advance...

by
6 Replies
  • Hi rock,

    What is your consumer key? Also by checking your POST content,
    it looks like at least the oauth_callback parameter is wrong.
    It must be "oob" or a valid URL.

    Thanks,
    Yu Wang
    Yahoo! Membership team
    0
  • QUOTE (omiga @ Apr 16 2010, 01:38 PM) <{POST_SNAPBACK}>
    Hi rock,

    What is your consumer key? Also by checking your POST content,
    it looks like at least the oauth_callback parameter is wrong.
    It must be "oob" or a valid URL.

    Thanks,
    Yu Wang
    Yahoo! Membership team


    Hey Omiga,

    I tried oob, I tried a valid url on the web(thats my website) but still it doesn't work.
    0
  • Hi rock,

    Can you please send the complete request and response headers?
    We cannot tell easily what goes wrong without seeing them.

    We need information like the following:

    Consumer key: dj0yJmk9TUJETmxhUG9WbDlPJmQ9WVdrOWR6Um9kRkl3TXpRbWNHbzlNVGszTVRBM05USXhOQS0tJnM9
    Y29uc3VtZXJzZWNyZXQmeD02MQ--
    URL: https://api.login.yahoo.com/oauth/v2/get_request_token
    HTTP POST data: oauth_version=1.0&oauth_nonce=8c76a87ffd3e4f48b53ed4b669b0b35f&oauth_timestamp=1268432350&oauth_consumer_key=dj0yJmk9TUJETmxhUG9WbDlPJmQ9WVdrOWR6Um9kRkl3TXpRbWNHbzlNV
    GszTVRBM05USXhOQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD02MQ--&oauth_signature_method=PLAINTEXT&oauth_signature=821ce9362da7d3d441265e77469a1339c42097612526&oauth_callback=oob"

    Thanks,
    Yu Wang
    Yahoo! Membership Team
    0
  • QUOTE (omiga @ Apr 18 2010, 02:18 PM) <{POST_SNAPBACK}>
    Hi rock,

    Can you please send the complete request and response headers?
    We cannot tell easily what goes wrong without seeing them.

    We need information like the following:

    Consumer key: dj0yJmk9TUJETmxhUG9WbDlPJmQ9WVdrOWR6Um9kRkl3TXpRbWNHbzlNVGszTVRBM05USXhOQS0tJnM9
    Y29uc3VtZXJzZWNyZXQmeD02MQ--
    URL: https://api.login.yahoo.com/oauth/v2/get_request_token
    HTTP POST data: oauth_version=1.0&oauth_nonce=8c76a87ffd3e4f48b53ed4b669b0b35f&oauth_timestamp=1268432350&oauth_consumer_key=dj0yJmk9TUJETmxhUG9WbDlPJmQ9WVdrOWR6Um9kRkl3TXpRbWNHbzlNV
    GszTVRBM05USXhOQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD02MQ--&oauth_signature_method=PLAINTEXT&oauth_signature=821ce9362da7d3d441265e77469a1339c42097612526&oauth_callback=oob"

    Thanks,
    Yu Wang
    Yahoo! Membership Team


    Hi there,

    Please see following information,
    Consumer Key:dj0yJmk9QUNLMjRPNXBJb2ZpJmQ9WVdrOVprWnlOMnh1TkdFbWNHbzlNVFExTXpRME16TTJNZy0t
    JnM9Y29uc3VtZXJzZWNyZXQmeD01OQ--
    URL: https://api.login.yahoo.com/oauth/v2/get_request_token
    POST Data:
    oauth_callback=oob&oauth_consumer_key=dj0yJmk9QUNLMjRPNXBJb2ZpJmQ9WVdrOVprWnlOMnh1TkdFbWNHbzlNV
    FExTXpRME16TTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD01OQ--&oauth_nonce=4621109&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1271647282&oauth_version=1.0&oauth_signature=DP31eqBp9aURH5Avw9JEcrigDL0%3d

    The signature is URL Encoded.
    Does the order of the Post Parameters matter?


    Thanks,
    Nilesh
    0
  • Hi Nilesh,

    Your consumer key is registered not requiring user authentication, so the
    get_request_token call is not applicable here.

    If you need to access user data such as Yahoo! Updates, Status and etc,
    then please make sure your consumer key belongs to the OAuth applications
    category:
    https://developer.apps.yahoo.com/projects

    You'll have to register a new consumer key.

    Thanks,
    Yu Wang
    0
  • Hi Yu Wang,

    Awesome! It started working suddenly, ofcourse I generated the consumer key again. Thank you ,Thank you very much for your help.

    Nilesh
    0

Recent Posts

in OAuth General Discussion YDN SDKs