PKCE
in
Specifies the methods required for the OAuth2 Proof Key for Code Exchange (PKCE)
Tags
Table of Contents
Constants
- CHALLENGE_METHOD_PLAIN = 'plain'
- CHALLENGE_METHOD_S256 = 'S256'
- VERIFIER_CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~'
Methods
- generateChallenge() : string
- generates a "code_challenge" for the given $codeVerifier
- generateVerifier() : string
- generates a secure random "code_verifier"
- setCodeChallenge() : array<string, string>
- Sets the PKCE code challenge parameters in a given array of query parameters and stores the verifier in the storage for later verification. Returns the updated array of parameters.
- setCodeVerifier() : array<string, string>
- Sets the PKCE verifier parameter in a given array of query parameters and deletes it from the storage afterwards. Returns the updated array of parameters.
Constants
CHALLENGE_METHOD_PLAIN
public
string
CHALLENGE_METHOD_PLAIN
= 'plain'
CHALLENGE_METHOD_S256
public
string
CHALLENGE_METHOD_S256
= 'S256'
VERIFIER_CHARSET
public
string
VERIFIER_CHARSET
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~'
Methods
generateChallenge()
generates a "code_challenge" for the given $codeVerifier
public
generateChallenge(string $verifier, string $challengeMethod) : string
Parameters
- $verifier : string
- $challengeMethod : string
Tags
Return values
stringgenerateVerifier()
generates a secure random "code_verifier"
public
generateVerifier(int $length) : string
Parameters
- $length : int
Tags
Return values
stringsetCodeChallenge()
Sets the PKCE code challenge parameters in a given array of query parameters and stores the verifier in the storage for later verification. Returns the updated array of parameters.
public
setCodeChallenge(array<string, string> $params, string $challengeMethod) : array<string, string>
Parameters
- $params : array<string, string>
- $challengeMethod : string
Tags
Return values
array<string, string>setCodeVerifier()
Sets the PKCE verifier parameter in a given array of query parameters and deletes it from the storage afterwards. Returns the updated array of parameters.
public
setCodeVerifier(array<string, string> $params) : array<string, string>
Parameters
- $params : array<string, string>