logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

OAuth::Lite2::Signer - OAuth 2.0 signature (DEPRECATED)

Author

       Lyo Kato, <lyo.kato@gmail.com>

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},
               url       => q{http://example.org/protected/resource},
           );

       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.

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},
               url       => q{http://example.org/protected/resource},
           );

See Also