Class PKCEHelper
-
- All Implemented Interfaces:
public final class PKCEHelper
Proof Key for Code Exchange (PKCE) by OAuth 2.0 public clients.
Where an OpenID Connect service provider has configured PKCE for authorization code-flow operations, generate a code verifier and code challenge.
For example:
<pre> {@code val codeVerifier = PKCE.generateCodeVerifier() val codeChallenge = PKCE.generateCodeChallenge(codeVerifier) print("SHA256 hash of codeVerifier: $codeChallenge") } </pre>- Since:
3.0.0
-
-
Constructor Summary
Constructors Constructor Description PKCEHelper()
-
Method Summary
Modifier and Type Method Description final static String
generateCodeVerifier()
Generates a cryptographically random string that is used to correlate the authorization request to the token request. final static String
generateCodeChallenge(String codeVerifier)
A challenge derived from the code verifier that is sent in the authorization request, to be verified against later. -
-
Method Detail
-
generateCodeVerifier
final static String generateCodeVerifier()
Generates a cryptographically random string that is used to correlate the authorization request to the token request.
- Returns:
Cryptographically random string
- Since:
3.0.0
-
generateCodeChallenge
final static String generateCodeChallenge(String codeVerifier)
A challenge derived from the code verifier that is sent in the authorization request, to be verified against later.
- Parameters:
codeVerifier
- : A cryptographically random string.- Returns:
Base-64 URL encoded string
- Since:
3.0.0
-
-
-
-