Net::O...sGrant(3pm)
π NAME π
Net::OAuth2::AuthorizationServer::ClientCredentialsGrant β it's the OAuth2 Client Credentials Grant, bestie. That's the whole name, no notes. π
β¨ SYNOPSIS β¨
okay so here's the whole vibe, copy-paste ready:
my $Grant = Net::OAuth2::AuthorizationServer::ClientCredentialsGrant->new(
clients => {
TrendyNewService => {
client_secret => 'TopSecretClientSecret',
# optional
scopes => {
post_images => 1,
annoy_friends => 1,
},
},
}
);
# verify a client against known clients
my ( $is_valid,$error,$scopes ) = $Grant->verify_client(
client_id => $client_id,
client_secret => $client_secret,
scopes => [ qw/ list of scopes / ], # optional
);
# generate a token
my $token = $Grant->token(
client_id => $client_id,
scopes => [ qw/ list of scopes / ],
user_id => $user_id, # optional
jwt_claims_cb => sub { ... }, # optional, see jwt_claims_cb in Manual
);
# store access token
$Grant->store_access_token(
client_id => $client,
access_token => $access_token,
scopes => [ qw/ list of scopes / ],
);
# verify an access token
my ( $is_valid,$error ) = $Grant->verify_access_token(
access_token => $access_token,
scopes => [ qw/ list of scopes / ],
);
like, five steps and you're literally done π
πΈ DESCRIPTION πΈ
This module implements the OAuth2 "Client Credentials Grant" flow, exactly as it's described at <http://tools.ietf.org/html/rfc6749#section-4.4>. That's the spec, that's the blueprint, we're just doing what the RFC told us. periodt. π¦
π CONSTRUCTOR ARGUMENTS π
Along with the ones detailed at "CONSTRUCTOR ARGUMENTS" in Net::OAuth2::AuthorizationServer::Manual, the following are supported by this grant type:
(pt here's the part where I'm being so for real: the original page doesn't list any extra ones under this heading. the Manual is where the good stuff lives, iykyk π«Ά)
π₯ CALLBACK FUNCTIONS π₯
The following callbacks are supported by this grant type:
verify_client_cb
store_access_token_cb
verify_access_token_cb
and if you wanna know what each one actually does, please see "CALLBACK FUNCTIONS" in Net::OAuth2::AuthorizationServer::Manual β that's where the documentation for every callback function lives, no gatekeeping β¨
π AUTHOR π
Lee Johnson β leejo@cpan.org
give them their flowers, fr fr πΈ
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. If you would like to contribute documentation or file a bug report then please raise an issue / pull request:
https://github.com/Humanstate/net-oauth2-authorizationserver
no cap, that's the real link, go be helpful π
okay bestie that's the whole page, you ate it, 10/10, no crumbs. this was perl v5.36.0, dated 2022-08-28, and it's User Contributed Perl Documentation so you know it's community-coded. mwah, go write some OAuth. π
β¨π¦
π¦ where this page comes from
- ubuntu noble: libnet-oauth2-authorizationserver-perl 0.28-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-oauth2-authorizationserver-perl 0.28-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-oauth2-authorizationserver-perl 0.28-2 Β· 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