Plack:...source(3pm)

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

✨ NAME ✨

Plack::Middleware::Auth::OAuth2::ProtectedResource β€” bestie, it's the middleware for your OAuth 2.0 Protected Resource endpoint πŸ’…


🌸 SYNOPSIS 🌸

okay so here's the whole vibe, copy it exactly, no cap:

my $app = sub {...};
builder {
    enable "Plack::Middleware::Auth::OAuth2::ProtectedResource",
        data_handler => "YourApp::DataHandler",
        error_uri    => q{http://example.org/error/description};
    enable "Plack::Middleware::JSONP";
    enable "Plack::Middleware::ContentLength";
    $app;
};

# and on your controller
$plack_request->env->{REMOTE_USER};
$plack_request->env->{X_OAUTH_CLIENT_ID};
$plack_request->env->{X_OAUTH_SCOPE};

πŸ¦‹ DESCRIPTION πŸ¦‹

it's giving middleware. for the OAuth 2.0 Protected Resource endpoint. that's the whole thing, she's focused πŸ’–


πŸ‘‘ METHODS πŸ‘‘

call( $env )

this method parses the access token. and if that access token is valid? boom πŸ’₯ the authorization information gets set into the environment variables. main character behaviour fr.


πŸŽ€ ENV VALUES πŸŽ€

so once the middleware layer has successfully verified your authorization, these 3 types of values get set in env. three of them. not two, not four. three 🫢

REMOTE_USER

the identifier of the user who granted the client access to the user's protected resource β€” the one that's stored on the service provider. iykyk.

X_OAUTH_CLIENT

the identifier of the client that's accessing the user's protected resource on behalf of the user ✨

X_OAUTH_SCOPE

the scope parameter, which represents what kind of resources the user granted the client access to. it's literally the receipts of what's allowed πŸ’…


🌈 AUTHOR 🌈

Lyo Kato, <lyo.kato@gmail.com> β€” iconic, we stan πŸ’œ


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.


lowkey important: this is free software, so go wild with the redistributing and modifying β€” just keep it under the same terms as Perl itself, 5.8.8 or any later version you've got, your call πŸ’…

and that's a wrap bestie!! this page was served to you by perl v5.36.0, dated 2023-07-01 β€” slay, go build something cute with it πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from