0

401 error while fetching request token

Hi All,

I am unable to fetch request token after going through dev guide http://developer.yahoo.com/oauth/guide/oau...questtoken.html and 'HTTPError: HTTP Error 401: Forbidden' is thrown

Here is the url that I am trying (removed key/signature)

https://api.login.yahoo.com/oauth/v2/get_re...ends%2Fyahoo%22

Please advice

by
3 Replies
  • Here is the output of wget command

    wget -S -d https://api.login.yahoo.com/oauth/v2/get_request_token --post-data="oauth_nonce=23309551&oauth_timestamp=1277884334&oauth_consumer_key=dj0yJmk9SlBMRG00TVM1OU9zJmQ9WVdrOVZtczNTbEYzTnpBbWNHbzlNV
    Ek0TmpRM09ERTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD0zYg--&oauth_signature_method=plaintext&oauth_signature=6054b888da5c19e2f7be69b1c3c1776e39f62443%26&oauth_version=1.0&xoauth_lang_pref=%22en-us%22&&oauth_callback=oob"

    Setting --post-data (postdata) to oauth_nonce=23309551&oauth_timestamp=1277884334&oauth_consumer_key=dj0yJmk9SlBMRG00TVM1OU9zJmQ9WVdrOVZtczNTbEYzTnpBbWNHbzlNV
    Ek0TmpRM09ERTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD0zYg--&oauth_signature_method=plaintext&oauth_signature=6054b888da5c19e2f7be69b1c3c1776e39f62443%26&oauth_version=1.0&xoauth_lang_pref=%22en-us%22&&oauth_callback=oob

    DEBUG output created by Wget 1.11.4 on linux-gnu.

    --2010-06-30 07:52:45-- https://api.login.yahoo.com/oauth/v2/get_request_token
    Resolving api.login.yahoo.com... 66.196.86.204
    Caching api.login.yahoo.com => 66.196.86.204
    Connecting to api.login.yahoo.com|66.196.86.204|:443... connected.
    Created socket 3.
    Releasing 0x09b30050 (new refcount 1).
    Initiating SSL handshake.
    Handshake successful; connected socket 3 to SSL handle 0x09b31120
    certificate:
    subject: /C=US/ST=California/L=Santa Clara/O=Yahoo! Inc./OU=Yahoo/CN=*.login.yahoo.com
    issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
    X509 certificate successfully verified and matches host api.login.yahoo.com

    ---request begin---
    POST /oauth/v2/get_request_token HTTP/1.0
    User-Agent: Wget/1.11.4
    Accept: */*
    Host: api.login.yahoo.com
    Connection: Keep-Alive
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 335

    ---request end---
    [POST data: oauth_nonce=23309551&oauth_timestamp=1277884334&oauth_consumer_key=dj0yJmk9SlBMRG00TVM1OU9zJmQ9WVdrOVZtczNTbEYzTnpBbWNHbzlNV
    Ek0TmpRM09ERTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD0zYg--&oauth_signature_method=plaintext&oauth_signature=6054b888da5c19e2f7be69b1c3c1776e39f62443%26&oauth_version=1.0&xoauth_lang_pref=%22en-us%22&&oauth_callback=oob]
    HTTP request sent, awaiting response...
    ---response begin---
    HTTP/1.1 200 OK
    Date: Wed, 30 Jun 2010 07:52:45 GMT
    P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
    Connection: close
    Content-Type: text/plain; charset=utf-8

    ---response end---

    HTTP/1.1 200 OK
    Date: Wed, 30 Jun 2010 07:52:45 GMT
    P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
    Connection: close
    Content-Type: text/plain; charset=utf-8
    Length: unspecified [text/plain]
    get_request_token: Permission denied
    Closed 3/SSL 0x09b31120

    Cannot write to `get_request_token' (Success).
    0
  • any response?
    0
  • Hi Tarun,

    I cannot reproduce the problem you saw. The following command works
    for me:

    wget -S -d https://api.login.yahoo.com/oauth/v2/get_request_token --post-data="oauth_nonce=23309551&oauth_timestamp=1278110021&oauth_consumer_key=dj0yJmk9SlBMRG00TVM1OU9zJmQ9WVdrOVZtczNTbEYzTnpBbWNHbzlNV
    Ek0TmpRM09ERTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD0zYg--&oauth_signature_method=plaintext&oauth_signature=6054b888da5c19e2f7be69b1c3c1776e39f62443%26&oauth_version=1.0&xoauth_lang_pref=%22en-us%22&&oauth_callback=oob"

    Actually, in your post, you said:

    HTTP/1.1 200 OK

    ...
    Cannot write to `get_request_token' (Success).

    This means that the request was successful, but wget couldn't write
    the file. You can add another option to wget such as "-O /tmp/get_request_token.txt"
    so that it can write to a different location that you have write access
    to.

    Thanks,
    Yu Wang
    Yahoo! Membership Team
    0

Recent Posts

in OAuth General Discussion YDN SDKs