Skip to content

Instantly share code, notes, and snippets.

@vkgtaro
Created September 16, 2009 13:55
Show Gist options
  • Save vkgtaro/188052 to your computer and use it in GitHub Desktop.
Save vkgtaro/188052 to your computer and use it in GitHub Desktop.
my $public_key = <<__END_OF_PUBLIC__;
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDASPndWVBy/VYe99aVM/5PWVdS
D3Vb5uAlK4cAPz091V/1SOeL3YSRuOposPMDjf5TlQuUr/TmNE6cbAUFV0hLFQuB
69KmJN+Bt8JwptFbuFetNKaMVESntg69+VPeuvuqo2+Ob7dcTXnvNxTfdJcwga9f
W5Af9jh82kQTWmZf5QIDAQAB
-----END PUBLIC KEY-----
__END_OF_PUBLIC__
my $verifier = OAuth::Lite::SignatureMethod::RSA_SHA1->new(
consumer_secret => $public_key,
);
my $params = $c->req->params;
my $oauth_signature = $params->{oauth_signature};
delete $params->{oauth_signature};
$c->log->debug($params);
my $base_string = create_signature_base_string($c->req->method, 'http://example.jp/test_for_opensocial', $params );
my $result = $verifier->verify($base_string, $oauth_signature);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment