PkceManager class
PKCE generator for OAuth 2.0 authorization code flow
Constructors
- PkceManager({String? codeVerifier, Random? random})
-
Create a manager that lazily derives the PKCE code challenge, either
reusing a supplied
codeVerifieror generating one fromrandom(defaults to a cryptographically secure source).
Properties
- challengeMethod → String
-
Get the challenge method (always S256 for SMART on FHIR)
no setter
- codeChallenge → String
-
Get the code challenge for the verifier
no setter
- codeVerifier → String
-
Get or generate the code verifier
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Reset the PKCE parameters (generates new ones on next access)
-
restore(
String verifier) → void -
Put back a code verifier made before the page was left for the
authorization server, so the token request can send it (RFC 7636
section 4.5). Throws ArgumentError when
verifieris not a valid code verifier (section 4.1: 43 to 128 unreserved characters). -
toAuthorizationParameters(
) → Map< String, String> - Create PKCE parameters for authorization request
-
toString(
) → String -
A string representation of this object.
inherited
-
toTokenParameters(
) → Map< String, String> - Create PKCE parameters for token request
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
isValidCodeVerifier(
String verifier) → bool - Validate a code verifier against RFC 7636 requirements
-
verifyChallenge(
{required String verifier, required String challenge, CodeChallengeMethod method = CodeChallengeMethod.s256}) → bool - Verify that a code verifier matches a challenge