OAuth::Lite2::Signer(3pm)

OAuth::Lite2::Signer3pm

Oauth 2.0 signature (deprecated)

Usage

    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},
    );

Overview

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.

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

Author

Lyo Kato, <[email protected]>

From liboauth-lite2-perl 0.11-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.