Credentials class

Credentials that prove that a client is allowed to access a resource on the resource owner's behalf.

These credentials are long-lasting and can be safely persisted across multiple runs of the program.

Many authorization servers will attach an expiration date to a set of credentials, along with a token that can be used to refresh the credentials once they've expired. The Client will automatically refresh its credentials when necessary. It's also possible to explicitly refresh them via Client.refreshCredentials or Credentials.refresh.

Note that a given set of credentials can only be refreshed once, so be sure to save the refreshed credentials for future use.

Constructors

Credentials(String accessToken, {String refreshToken, String idToken, Uri tokenEndpoint, Iterable<String> scopes, DateTime expiration, String delimiter, Map<String, dynamic> getParameters(MediaType mediaType, String body)})
Creates a new set of credentials. [...]
Credentials.fromJson(String json)
Loads a set of credentials from a JSON-serialized form. [...]
factory

Properties

accessToken String
The token that is sent to the resource server to prove the authorization of a client.
final
canRefresh bool
Whether it's possible to refresh these credentials.
read-only
expiration DateTime
The date at which these credentials will expire. [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
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). [...]
final
isExpired bool
Whether or not these credentials have expired. [...]
read-only
refreshToken String
The token that is sent to the authorization server to refresh the credentials. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scopes List<String>
The specific permissions being requested from the authorization server. [...]
final
tokenEndpoint Uri
The URL of the authorization server endpoint that's used to refresh the credentials. [...]
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited