Plack:...source(3pm)
β¨ 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 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.
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
- debian trixie: liboauth-lite2-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liboauth-lite2-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liboauth-lite2-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liboauth-lite2-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms