Quote....Would have a base string that looks like the following:
GET&https%3A%2F%2Fwww.flickr.com%2Fservices%2Foauth%2Frequest_token&oauth_callback%3Dhttp%253A%252F%252Fwww.example.com%26oauth_consumer_key%3D653e7a6ecc1d528c516cc8f92cf98611%26oauth_nonce%3D95613465%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1305586162%26oauth_version%3D1.0
Which would generate the following signature:
7w18YS2bONDPL%2FzgyzP5XTr5af4%3D
QuoteTo generate a signature, we take our shared secret to prepend it to an alphabetically sorted list of arguments. In this example, our arguments are:
method = flickr.auth.getFrob
api_key = 9a0554259914a86fb9e7eb014e4e5d52
So our signature string is:
000005fab4534d05api_key9a0554259914a86fb9e7eb014e4e5d52methodflickr.auth.getFrob
We then take the MD5 sum of this string and use it as our signature. It should be added as a named argument called 'api_sig'. Our argument list now looks like this:
method = flickr.auth.getFrob
api_key = 9a0554259914a86fb9e7eb014e4e5d52
api_sig = 8ad70cd3888ce493c8dde4931f7d6bd0
1
2
3
4
5
...
use Digest::SHA qw(sha1 sha1_hex sha1_base64);
...
$sig = sha1_hex($base_string);
...
1
2
3
4
5
...
use Digest::MD5 qw(md5_hex);
...
$sig = md5_hex(encode('utf8', $base_string));
...