OAuthChopper class

OAuthChopper client for configuring OAuth authentication with Chopper.

For example:

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

Constructors

OAuthChopper.new({required Uri authorizationEndpoint, required String identifier, required String secret, Uri? endSessionEndpoint, Client? httpClient, OAuthStorage? storage})
OAuthChopper client for configuring OAuth authentication with Chopper.

Properties

authorizationEndpoint Uri
OAuth authorization endpoint.
final
endSessionEndpoint Uri?
OAuth endpoint to end session.
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
interceptor → OAuthInterceptor
Provides an OAuthInterceptor instance.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secret String
OAuth secret.
final
token Future<OAuthToken?>
Get stored OAuthToken.
no setter

Methods

authenticator({OnErrorCallback? onError}) → OAuthAuthenticator
Provides an OAuthAuthenticator instance. The authenticator can throw exceptions when OAuth authentication fails. 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() 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. See oauth2.Credentials.refresh
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