The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OAuth::Lite2::ParamMethod - base class of builder/parser for OAuth 2.0 parameters

SYNOPSIS

my $meth = OAuth::Lite2::ParamMethod::Foo->new;

# server side
if ($meth->match( $plack_request )) {
    my ($token, $params) = $meth->parse( $plack_request );
}

# client side
my $http_req = $meth->request_builder(...);

DESCRIPTION

base class of builder/parser for OAuth 2.0 parameters

METHODS

new

Constructor

match( $plack_request )

Returns true if passed Plack::Request object is matched for the type of this method.

if ( $meth->match( $plack_request ) ) {
    ...
}

parse( $plack_request )

Parse the Plack::Request, and returns access token and oauth parameters.

my ($token, $params) = $meth->parse( $plack_request );

build_request( %params )

Build HTTP::Request object.

my $req = $meth->build_request(
    url          => $url,
    method       => $http_method,
    token        => $access_token,
    oauth_params => $oauth_params,
    params       => $params,
    content      => $content,
    headers      => $headers,
);

SEE ALSO

OAuth::Lite2::ParamMethods OAuth::Lite2::ParamMethod::AuthHeader OAuth::Lite2::ParamMethod::FormEncodedBody OAuth::Lite2::ParamMethod::URIQueryParameter

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.