OAuthContext class abstract
Per-authorization state that must be carried from authorize to
callback.
codeVerifier: The PKCE code verifier (RFC 7636).state: The opaquestatevalue used to correlate the callback with this authorization request (CSRF protection).dpopNonce: The latest DPoP nonce provided by the server, if any. Thedpop-nonceheader is optional per RFC 9449, so this may benullwhen the server has not provided one.issuer: The authorization server issuer identifier resolved via RFC 8414 metadata discovery. Used to validate theisscallback parameter (RFC 9207).tokenEndpoint: The token endpoint resolved via RFC 8414 metadata discovery.dpopPublicKey/dpopPrivateKey: The encoded DPoP key pair generated duringauthorizeand used to sign the DPoP proof on the PAR request. The atproto authorization server binds the pushed authorization request to this key's thumbprint, so the same key pair must be used again for the token request incallback. These may benullfor contexts serialized by older versions of this library, in which casecallbackgenerates a fresh key pair.pds: The user's Personal Data Server (PDS) URL, carried fromauthorizeso it can be used to populate the resulting session incallback.expectedSub: The expected subject (DID) of the authorized account, carried fromauthorizeso the token response'ssubcan be verified incallback.
Security warning: when dpopPrivateKey is set, this object contains
sensitive key material. Only persist it (e.g. via toJson) into
encrypted or otherwise access-controlled storage.
- Available extensions
- Annotations
-
- @freezed
Constructors
Properties
- codeVerifier → String
-
no setterinherited
-
copyWith
→ $OAuthContextCopyWith<
OAuthContext> -
Create a copy of OAuthContext
with the given fields replaced by the non-null parameter values.
no setterinherited
- dpopNonce → String?
-
no setterinherited
- dpopPrivateKey → String?
-
no setterinherited
- dpopPublicKey → String?
-
no setterinherited
- expectedSub → String?
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- issuer → String?
-
no setterinherited
- pds → String?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → String
-
no setterinherited
- tokenEndpoint → String?
-
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_OAuthContext value)) → TResult -
Available on OAuthContext, provided by the OAuthContextPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_OAuthContext value)?) → TResult? -
Available on OAuthContext, provided by the OAuthContextPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_OAuthContext value)?, {required TResult orElse()}) → TResult -
Available on OAuthContext, provided by the OAuthContextPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(String codeVerifier, String state, String? dpopNonce, String? issuer, String? tokenEndpoint, String? dpopPublicKey, String? dpopPrivateKey, String? pds, String? expectedSub)?, {required TResult orElse()}) → TResult -
Available on OAuthContext, provided by the OAuthContextPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this OAuthContext to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(String codeVerifier, String state, String? dpopNonce, String? issuer, String? tokenEndpoint, String? dpopPublicKey, String? dpopPrivateKey, String? pds, String? expectedSub)) → TResult -
Available on OAuthContext, provided by the OAuthContextPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String codeVerifier, String state, String? dpopNonce, String? issuer, String? tokenEndpoint, String? dpopPublicKey, String? dpopPrivateKey, String? pds, String? expectedSub)?) → TResult? -
Available on OAuthContext, provided by the OAuthContextPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited