Skip Menu |
 

This queue is for tickets about the Net-OAuth CPAN distribution.

Report information
The Basics
Id: 75942
Status: resolved
Priority: 0/
Queue: Net-OAuth

People
Owner: Nobody in particular
Requestors: Jeremy [...] Malcolm.id.au
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.28
Fixed in: (no value)



Subject: Generating invalid signature
Download (untitled) / with headers
text/plain 1.3k
This may be a misunderstanding of the documentation rather than a bug, but it seems to me that this should work: #!/usr/bin/perl use Net::OAuth; use LWP::UserAgent; $consumer_key = "7ee438dcff906a5dd9f8d47da2d4b302"; $consumer_secret = "50376257d668ed6e5a4185e6ef51bf9b"; $url = "https://identi.ca/api/statuses/update.json"; $token = "b75393878750a4b3db0703045947022f"; $token_secret = "76cec704d4f5baf24f2a58659bad05ae"; my $ua = LWP::UserAgent->new; my $request = Net::OAuth->request("protected resource")->new( consumer_key => $consumer_key, consumer_secret => $consumer_secret, request_url => $url, request_method => 'GET', signature_method => 'HMAC-SHA1', timestamp => time, nonce => int(rand(2 ** 32)), token => $token, token_secret => $token_secret, extra_params => {status => $message}, ); $request->sign; my $response = $ua->get($request->request_url, Authorization => $request->to_authorization_header ); print $response->code . ": " . $response->message . "\n"; Yet it doesn't. It isn't an identi.ca problem because I've also tried the same code with Twitter with the same result, which is "401 Unauthorised". Identi.ca gives slightly more information, saying "Invalid signature". (Of course, the secrets in the code above are made up, but the ones I'm using are correct.) I'm using Perl 5.10.1 and Net::OAuth 0.28 on Linux.
Download (untitled) / with headers
text/plain 323b
On Wed Mar 21 11:27:36 2012, http://jere.my/ wrote: Show quoted text
In my sample code I forgot to change this to "https://identi.ca/api/account/verify_credentials.json". Show quoted text
> extra_params => {status => $message},
And forgot to delete this line... does not affect the bug, though.
From: Jeremy Malcolm
Download (untitled) / with headers
text/plain 178b
Sorry, the problem was my fault. Despite having thought I'd checked everything, the token secret was off by one character. Please close the bug report and sorry for the noise.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.