OneIdAuthResult class
The token set obtained from a successful authorization or refresh, and what's needed to persist + refresh it later.
- Annotations
Constructors
-
OneIdAuthResult({required String accessToken, required String tokenType, String? refreshToken, String? idToken, DateTime? accessTokenExpiration, List<
String> scopes = const []}) -
const
-
OneIdAuthResult.fromJson(Map<
String, dynamic> json) -
Parses either a raw OAuth token response (
expires_inseconds, as returned by the token endpoint) or this class's own toJson shape (expires_atISO-8601, as read back from storage).factory
Properties
- accessToken → String
-
Short-lived, DPoP-bound credential attached to API requests as
Authorization: <tokenType> <accessToken>plus a matchingDPoPproof header (RFC 9449).final - accessTokenExpiration → DateTime?
-
When accessToken expires, if the server reported
expires_in.final - hashCode → int
-
The hash code for this object.
no setterinherited
- idToken → String?
-
OIDC identity token, if the
openidscope was requested. Contains signed identity claims — verify its signature before trusting its contents.final - isExpired → bool
-
True once accessTokenExpiration has passed, or unknown expiry is
treated as expired to force a refresh.
no setter
- refreshToken → String?
-
Long-lived credential used to obtain a new accessToken without
re-prompting the user. Only present if the
offline_accessscope (or equivalent) was granted.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scopes
→ List<
String> -
The scopes actually granted (may be a subset of what was requested).
final
- tokenType → String
-
Almost always
"DPoP"for this SDK — seeOneIdAuthConfig.final
Methods
-
isExpiringWithin(
Duration skew) → bool -
True if accessTokenExpiration is within
skewof now — use this (rather than isExpired) to refresh proactively before a call fails. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited