Authenticator class abstract
The Authenticator class provides an interface to interact with the Reddit API using OAuth2. An Authenticator is responsible for keeping track of OAuth2 credentials, refreshing and revoking access tokens, and issuing HTTPS requests using OAuth2 credentials.
- Implementers
Constructors
- Authenticator(DRAWConfigContext config, AuthorizationCodeGrant grant)
- Authenticator.restore(DRAWConfigContext config, Credentials credentials)
Properties
- credentials → Credentials
-
The credentials associated with this authenticator instance.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isValid → bool
-
A flag representing whether or not this authenticator instance is valid.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userAgent → String
-
The user agent value to be presented to Reddit.
no setter
Methods
- Not implemented for Authenticators other than WebAuthenticator.
-
delete(
Uri path, {Map< String, String> ? body}) → Future -
Make a simple
DELETE
request. -
get(
Uri path, {Map< String, String?> ? params, bool followRedirects = false}) → Future -
Make a simple
GET
request. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
post(
Uri path, Map< String, String?> ? body, {Map<String, Uint8List?> ? files, Map? params}) → Future -
Make a simple
POST
request. -
put(
Uri path, {Map< String, String> ? body}) → Future -
Make a simple
PUT
request. -
refresh(
) → Future< void> - Request a new access token from the Reddit API. Throws a DRAWAuthenticationError if the Authenticator is not yet initialized.
-
revoke(
) → Future< void> - Revokes any outstanding tokens associated with the Authenticator.
-
toString(
) → String -
A string representation of this object.
inherited
-
url(
List< String> scopes, String state, {String duration = 'permanent', bool compactLogin = false}) → Uri - Not implemented for Authenticators other than WebAuthenticator.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited