OAuthChopper class

OAuthChopper client for configuring OAuth authentication with Chopper.

For example:

  final oauthChopper = OAuthChopper(
    authorizationEndpoint: authorizationEndpoint,
    identifier: identifier,
    secret: secret,
  );

Constructors

OAuthChopper({required Uri authorizationEndpoint, required String identifier, String? secret, Uri? endSessionEndpoint, Client? httpClient, Iterable<String>? scopes, bool basicAuth = true, String? delimiter, Map<String, dynamic> getParameters(MediaType? contentType, String body)?, OAuthStorage? storage})
OAuthChopper client for configuring OAuth authentication with Chopper.

Properties

authorizationEndpoint Uri
OAuth authorization endpoint.
final
basicAuth bool
Whether to use HTTP Basic authentication for authorizing the client. Will be passed to oauth2.
final
delimiter String?
A String used to separate scopes; defaults to " ". Will be passed to oauth2.
final
endSessionEndpoint Uri?
OAuth endpoint to end session.
final
getParameters Map<String, dynamic> Function(MediaType? contentType, String body)?
The function used to parse parameters from a host's response. Will be passed to oauth2.
final
hashCode int
The hash code for this object.
no setterinherited
httpClient → Client?
Provide a custom http.Client which will be passed to oauth2 and used for making new requests.
final
identifier String
OAuth identifier
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopes Iterable<String>?
The scopes that the client is requesting access to. Will be passed to oauth2.
final
secret String?
OAuth secret.
final
token Future<OAuthToken?>
Get stored OAuthToken.
no setter

Methods

interceptor({OnErrorCallback? onError}) → OAuthInterceptor
Provides an OAuthInterceptor instance. If onError is provided exceptions will be passed to onError and not be thrown.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh({bool basicAuth = true, Iterable<String>? newScopes}) Future<OAuthToken?>
Tries to refresh the available credentials and returns a new OAuthToken instance. Throws an exception when refreshing fails. If the exception is a oauth2.AuthorizationException it clears the storage.
requestGrant(OAuthGrant grant) Future<OAuthToken>
Request an OAuthGrant and stores the credentials in the _storage.
toString() String
A string representation of this object.
inherited

Operators

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