Credentials class
A user's access and refresh tokens plus metadata needed to access services.
The base oauth2 implementation is extended to provided extra functionality around the refresh process, including being alerted to errors and verifying, cryptographically, the tokens received.
Constructors
- Credentials(Token _accessToken, Token? _refreshToken, Config _config, {Token? idToken, required StorageRepo storageRepo, required Client httpClient})
Properties
- accessToken → String
-
The token that is sent to the resource server to prove the authorization
of a client.
no setter
- canRefresh → bool
-
Whether it's possible to refresh these credentials.
no setter
- expiration → DateTime?
-
The date at which these credentials will expire.
no setter
- expirationSecondsSinceEpoch → int?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- idToken → String?
-
The token that is received from the authorization server to enable
End-Users to be Authenticated, contains Claims, represented as a
JSON Web Token (JWT).
no setter
- isExpired → bool
-
Whether or not these credentials have expired.
no setter
- refreshToken → String?
-
The token that is sent to the authorization server to refresh the
credentials.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scopes
→ List<
String> -
The specific permissions being requested from the authorization server.
no setter
- tokenEndpoint → Uri
-
The URL of the authorization server endpoint that's used to refresh the
credentials.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
{String? identifier, String? secret, Iterable< String> ? newScopes, bool basicAuth = true, Client? httpClient}) → Future<Credentials> - Returns a new set of refreshed credentials.
-
toJson(
) → String - Serializes a set of credentials to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromOAuthCredentials(
Credentials creds, {required Config config, required StorageRepo storageRepo, required Client httpClient}) → Credentials