Deprecated.
NAME
OAuth::Lite2::Signer - OAuth 2.0 signature (DEPRECATED)
SYNOPSIS
my
$signed_params
= OAuth::Lite2::Signer->sign(
secret
=>
q{my_token_secret}
,
algorithm
=>
q{hmac-sha256}
,
method
=>
q{GET}
,
);
DESCRIPTION
DEPRECATED. This is for old version of OAuth 2.0 draft specification.
This is for client to generate signed request, or for server to verify received request.
METHODS
sign( %params )
Returns the hash reference that includes parameters for OAuth 2.0 signed request.
my
$signed_params
= OAuth::Lite2::Signer->sign(
secret
=>
q{my_token_secret}
,
algorithm
=>
q{hmac-sha256}
,
method
=>
q{GET}
,
);
- secret
-
Access token secret.
- algorithm
-
The algorithm what you make signature with.
- method
-
HTTP method of the request.
- url
-
URL of the request.
- debug_nonce
-
Optional. If you omit this, nonce string is automatically generate random string.
- debug_timestamp
-
Optional. If you omit this, current timestamp is set.
normalize_string( %params )
Returns normalized string according to the specification.
- host
-
host part of the url.
- port
-
If you omit this, 80 is set by default.
- nonce
-
Random string.
- timestamp
-
unix timestamp.
- algorithm
-
name of hmac hash algorithm.
- method
-
HTTP method of the request.
- url
-
URL of the request.
verify( %params )
Verify a signed request.
unless
( OAuth::Lite2::Signer->verify(
%params
) ) {
$app
->error(
"Invalid request"
);
}
- signature
-
'signature' parameter of the received request.
- secret
-
The access token secret.
- algorithm
-
'algorithm' parameter of the received request.
- method
-
HTTP method of the received request.
- url
-
URL of the received request.
- nonce
-
'nonce' parameter of the received request.
- timestamp
-
'timestamp' parameter of the received request.
AUTHOR
Lyo Kato, <lyo.kato@gmail.com>
COPYRIGHT AND LICENSE
Copyright (C) 2010 by Lyo Kato
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.