Browser-OIDC
view release on metacpan or search on metacpan
NAME
Browser::OIDC - Get an OIDC token for a CLI application
SYNOPSIS
my $oidc = Browser::OIDC->new_from_discovery($base_url);
my $token = $oidc->get_token(
client_id => 'me',
scope => [ 'email' ],
);
DESCRIPTION
This module will open a browser for you to log into some OIDC provider,
and will temporarily run a webserver on localhost to receive the
redirect with the results from your browser.
METHODS
new_from_discovery
my $oidc = Browser::OIDC->new($base_url);
This creates a new Browser::OIDC object. This will fetch the
configuration for the given $base_url.
new_from_config
my $oidc = Browser::OIDC->new($config);
This creates a new Browser::OIDC object. This use a OIDC discovery
configuration instead of fetching it.
get_token
$oidc->get_token(%options);
This fetches OIDC tokens from the endpoint. Note though that this
module only fetches the tokens, it will not perform any decoding or
verification on them.
It takes the following options:
client_id
The client identifier. Mandatory.
client_secret
The client secret, if any.
scope
This list will be the scopes of the request. 'openid' is
automatically added to this list so does not need to be given.
nonce
The nonce used in the request. If none if given one will be generated
automatically.
message
The message that will be shown to the user in the browser on
completion.
message_type
The content type of the message e.g. text/plain or text/html.
display
ASCII string value that specifies how the Authorization Server
displays the authentication and consent user interface pages to the
End-User. The defined values are: page, popup, touch, and wap.
prompt
Case-sensitive list of ASCII string values that specifies whether the
Authorization Server prompts the End-User for reauthentication and
consent. The defined values are: none, login, consent, and
select_account.
max_age
Maximum Authentication Age. Specifies the allowable elapsed time in
seconds since the last time the End-User was actively authenticated
by the OP. Note that max_age=0 is equivalent to prompt=login.
login_hint
Hint to the Authorization Server about the login identifier the
End-User might use to log in (if necessary).
issuer
$oidc->issuer;
( run in 0.870 second using v1.01-cache-2.11-cpan-99fa8243a42 )