There is an ongoing outage on the primary CPAN mirror. It is possible to work around the issue by using MetaCPAN as a mirror.

NAME

OIDC::Client::AccessToken - Access Token class

DESCRIPTION

Class representing an access token

ATTRIBUTES

token

The string of the access token. Required

token_type

The type of the access token

expires_at

The expiration time of the access token (number of seconds since 1970-01-01T00:00:00Z)

scopes

The scopes (arrayref) of the access token

claims

Hashref of claims coming from the access token. Optional, as an access token is not always decoded, depending on the nature of the application.

METHODS

has_scope( $expected_scope )

my $has_scope = $access_token->has_scope($expected_scope);

Returns whether a scope is present in the scopes of the access token.

has_expired( $leeway )

my $has_expired = $access_token->has_expired();

Returns whether the access token has expired.

Returns undef if the expires_at attribute is not defined.

The list parameters are:

leeway

Number of seconds of leeway for the token to be considered expired before it actually is.

to_hashref()

my $access_token_href = $access_token->to_hashref();

Returns a hashref of the access token data.