OAuth:...edBody(3pm)

πŸ“¦
version 0.11 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, gather round: this is OAuth::Lite2::ParamMethod::FormEncodedBody β€” it's the builder/parser for the OAuth 2.0 FormEncodedBody type of parameter. that's the whole vibe. it builds them, it parses them, it's giving ✨middleware for form bodies✨.

it lives in the User Contributed Perl Documentation section of the manual, if you were wondering where to find it 🫢


🌸 SYNOPSIS 🌸

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

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

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

πŸ¦‹ DESCRIPTION πŸ¦‹

literally what it says on the tin, no cap: it's a builder/parser for OAuth 2.0 FormEncodedBody type of parameter. build them on the client side, parse them on the server side, and let this little icon do the heavy lifting πŸ’…


πŸ‘‘ METHODS πŸ‘‘

✨ new

Constructor. that's it, that's the method. spawns you a fresh object πŸŽ€

✨ match( $plack_request )

returns true if the Plack::Request object you handed it is matched for the type of this method. vibe check: passed βœ…

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

✨ parse( $plack_request )

parses the Plack::Request, and returns the access token and the oauth parameters. two things back, in that order, bestie β€” don't mix them up 😭

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

✨ build_request( %params )

builds an HTTP::Request object for you. so considerate of it 🫢

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

✨ is_legacy( $plack_request )

returns true if the passed Plack::Request object is based on draft version 10. yes, draft version 10. we do NOT talk about draft version 10, but we do support it, because we're nice like that πŸ’€

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

🌈 SEE ALSO 🌈

  • OAuth::Lite2::ParamMethods
  • OAuth::Lite2::ParamMethod
  • OAuth::Lite2::ParamMethod::AuthHeader
  • OAuth::Lite2::ParamMethod::URIQueryParameter

go read those too, they're the rest of the squad 🧚


πŸ’œ AUTHOR πŸ’œ

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


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.

so basically: same terms as Perl itself, your choice of Perl 5.8.8 or whatever later version of Perl 5 you've got. slay, and also please read the actual license text, not just my summary, i'm a vibe not a lawyer 😭

and that's the whole page, bestie! mwah πŸ’‹ this one was documented by perl v5.36.0 and last touched on 2023-07-01, and it lives in the User Contributed Perl Documentation collection. go forth and encode some forms fr fr πŸ’…βœ¨

πŸ“¦ where this page comes from