NAME

OIDC::Client::Utils - Utility functions

DESCRIPTION

Exports utility functions.

FUNCTIONS

get_values_from_space_delimited_string( $value )

Returns the values (arrayref) from a space-delimited string value.

reach_data( $data_tree, \@path, $optional )

Simplified data diver. No support for arrayref nodes.

Tries to find a node under root $data_tree, walking down the tree and choosing subnodes according to values given in $path (which should be an arrayref of scalar values).

While walking down the tree, if a key doesn't exist, undef is returned if the $optional parameter is true (default value), otherwise an exception is thrown if the $optional parameter is false.

No autovivification is performed by this function.

affect_data( $data_tree, \@path, $value )

Walks down the $data_tree and sets the $value to the subnode according to values given in $path (which should be an arrayref of scalar values).

Arrayref nodes are not supported.

Autovivification can be performed by this function.

delete_data( $data_tree, \@path )

Walks down the $data_tree, deletes the key of the last subnode and returns its value according to values given in $path (which should be an arrayref of scalar values).

Arrayref nodes are not supported.

While walking down the tree, if a key doesn't exist, undef is returned.

No autovivification is performed by this function.

generate_state

Generates a cryptographically secure OAuth 2.0 state value. Returns a base64url-encoded string of 22 characters.

generate_nonce

Generates a cryptographically secure OpenID Connect nonce value. Returns a base64url-encoded string of 22 characters.

generate_jti

Generates a cryptographically secure JWT ID (jti) value. Returns a base64url-encoded string of 22 characters.

generate_code_verifier

Generates a cryptographically secure random code verifier for PKCE. Returns a base64url-encoded string of 43 characters.

generate_code_challenge($code_verifier, $code_challenge_method)

Generates the code challenge from a code verifier and a code challenge method.