0

oauth_problem=token_rejected

I'm working on a Yahoo! Mail api script. It works but every time I try to refresh my access token I get the error "oauth_problem=token_rejected". I'm good for an hour but then it times out no matter what I try. I tried HMAC-SHA1 and PLAINTEXT, GET and PUT, and so on. Any help would be appreciated.

I'm working based on this
http://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html
http://wiki.oauth.net/w/page/12238543/ProblemReporting

*********************************************
refresh request code
*********************************************

my $request = Net::OAuth->request("access token")->new(
    consumer_key => $consumer_key,
    signature_method => 'PLAINTEXT',
    nonce => $nonce,
    signature => $signature,
    timestamp => time,
    verifier => $yahooVerifier,
    consumer_secret => $consumer_secret,
    version => '1.0',
    token => $oauth_token,
    token_secret => $oauth_token_secret,
    session_handle => $oauth_session_handle,
    request_url => $second_request_url,
    request_method => 'GET'
);
$request->sign;

my $res = $ua->request(GET $request->to_url);

if (!$res->is_success) {
    #...handle problem ...
}else{
    #... do something ...
}

*********************************************
some of the actual values
*********************************************
token:
ugxa4yh

token_secret:
5bb7f7f64b82940f8a13e9e247f1a1578606caee

signature:
ec41xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4019%2646fc24aa1896705446b9cb998918ee0f6dd1379a


yahooVerifier:
gatyu8

oauth_token:
A=lTFi2XzusSu.cWxRrSnXEw2dv5bM_ao.2WMLPlDso75JqsbUVeU90S6FyRrD2vG1a1vHjtNhj2XGww_QVosmaM2zqSutvg69UKQFAZqKVK69cJXhNlaAHcUUsdqujBdf7ngfiViWamJqAgkGCcQLzVfVHr.qndQ9utHAqWeCLMCO2OWphdJ.JGop65ssoLIxk8J40.GpGiZSxANxG1ye1MeYSqoBf5HnNFIg1aghkjVdxqIuvtR_v2hxabAy4Sa23Xu7XGxFhizjeJ5gSo9D.UaNeTobtK_rBe_10krUkd72kjxBpORpTfU.HoWZMoD4g3DS3ErU7DVPl3OOUEzGVEnS3KREaxz5MDiTRtjkDVDy5OmGah8dDSsiRSe9dztQY0JNheia2U0xoUlx_yYce8BTAZq0BUmvZpzCnKvOc4uMlTpC36CNWyLtBCrLwKLo2txN__0.TMekpumVOvLAMfM_8n1KjCFXXARZvwZJ8hvsRv49KsDvhFTtcxspyJeoi.jsAkQfTDMWlvZ250VzrgGIQThGXkVxaZZfGon.bGHRNInI1IsFC0mZn9g_eYJ9V4FYaLLX_lnw90S7cMGonVpJ7eCkEfrYVSNRTIqqxtZzvXH_oTFzjYSx08lT___E5otmHEYYHbsiNRQb1VUr3Cv4i_5K4zXxOhDkRaGiYBeuFd5opBjz89L4nU1f6nd80jimuyOxHYiC2U_3JeMW7RIRyrEBqLTQVLZhRd1S.jTFq_mtyb2SbA_7Z_N7k8v1MDx0kKfMVg--

oauth_token_secret:
46fc24aa1896705446b9cb998918ee0f6dd1379a

oauth_session_handle:
AN7OpU0wXweGS3NjY5N44bfcHet.Yxx2isk0rWvV2rtm6WRiVk7lvAafN4bG

oauth_expires_in:
3600

*********************************************
error
*********************************************

error: HTTP/1.1 401 Forbidden Connection: close Date: Fri, 04 Nov 2011 20:50:03 GMT WWW-Authenticate: OAuth oauth_problem=token_rejected Content-Type: application/x-www-form-urlencoded Client-Date: Fri, 04 Nov 2011 20:50:03 GMT Client-Peer: 68.142.197.104:443 Client-Response-Num: 1 Client-SSL-Cert-Issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority Client-SSL-Cert-Subject: /C=US/ST=California/L=Santa Clara/O=Yahoo! Inc./OU=Yahoo/CN=*.login.yahoo.com Client-SSL-Cipher: AES256-SHA Client-SSL-Warning: Peer certificate not verified Client-Transfer-Encoding: chunked Client-Warning: Unsupported authentication scheme 'oauth' 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" oauth_problem=token_rejected

by
1 Reply
  • haha november 2011

    i'm so happy that i'm developing against the yahoo api

    2

Recent Posts

in OAuth General Discussion YDN SDKs