Documentation

PKCE

Specifies the methods required for the OAuth2 Proof Key for Code Exchange (PKCE)

Tags
link
https://datatracker.ietf.org/doc/html/rfc7636
link
https://github.com/AdrienGras/pkce-php

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

setCodeChallenge()

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
link
https://datatracker.ietf.org/doc/html/rfc7636#section-4.3
throws
ProviderException
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>
Tags
link
https://datatracker.ietf.org/doc/html/rfc7636#section-4.5
throws
ProviderException
Return values
array<string, string>

        
On this page

Search results