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::ParamMethods - store of builders/parsers for OAuth 2.0 parameters

Author

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

Constants

       AUTH_HEADER
       FORM_BODY
       URI_QUERY

Description

       Store of builders/parsers for OAuth 2.0 parameters

Methods

get_param_parser($plack_request)
       Pass a Plack::Request object and proper parser for the request.

           my $parser = OAuth::Lite2::ParamMethods->get_param_parser( $plack_request )
               or $app->error("This is not OAuth 2.0 request");
           my ($token, $params) = $parser->parse( $plack_request );

   get_request_builder($type)
       Returns proper HTTP request builder for the passed $type.

           my $builder = OAuth::Lite2::ParamMethods->get_request_builder( AUTH_HEADER );
           my $req = $builder->build_request(...);

Name

       OAuth::Lite2::ParamMethods - store of builders/parsers for OAuth 2.0 parameters

See Also

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

Synopsis

           use OAuth::Lite2::ParamMethods qw(AUTH_HEADER FORM_BODY URI_QUERY);

           # client side
           my $builder = OAuth::Lite2::ParamMethods->get_request_builder( AUTH_HEADER );
           my $req = $builder->build_request(...);

           # server side
           my $parser = OAuth::Lite2::ParamMethods->get_param_parser( $plack_request )
               or $app->error("This is not OAuth 2.0 request");
           my ($token, $params) = $parser->parse( $plack_request );

return

See Also