OAuthAuthorizationCode class
Represents an authorization code issued to a client.
Only codeHash is persisted. The raw code is returned to the client once and hashed before it reaches the store.
Constructors
- OAuthAuthorizationCode({required String authorizationId, required String codeHash, required String clientId, required String userId, required String redirectUri, required String scope, required DateTime expiresAt, String? codeChallenge, String? codeChallengeMethod, String? nonce, DateTime? createdAt})
-
const
Properties
-
Stable persistence identifier for this authorization.
final
- clientId → String
-
Client that requested the code.
final
- codeChallenge → String?
-
PKCE code challenge (optional).
final
- codeChallengeMethod → String?
-
PKCE code challenge method (optional).
final
- codeHash → String
-
Digest of the raw authorization code.
final
- createdAt → DateTime?
-
When the code was created.
final
- expiresAt → DateTime
-
When the code expires.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- nonce → String?
-
OIDC nonce (optional).
final
- redirectUri → String
-
Redirect URI for this authorization.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scope → String
-
Granted scopes.
final
- userId → String
-
User who authorized the code.
final
Methods
-
isValid(
{DateTime? now}) → bool - Whether the code is still valid.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toStorageJson(
) → Map< String, dynamic> - Serializes persistence-safe data without the raw authorization code.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited