OAuth2AuthProvider class abstract

Authentication provider for services with OAuth2. Which are basically the most of them, including OpenStreetMap.

Inheritance

Constructors

OAuth2AuthProvider({required String authorizeUrl, required String tokenUrl, required String clientId, required String clientSecret, required List<String> scopes})

Properties

endpoint String
Service endpoint to make requests.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
icon MultiIcon?
An icon for the settings panel.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
A title for the settings panel.
no setterinherited

Methods

getApiKey(AuthToken token) String
Returns a string to be supplied to API, if it needs one.
inherited
getHeaders(AuthToken token) Map<String, String>
Returns headers to be added to an API request. Usually this adds a single "Authentication" header, but this depends on the API.
override
loadUserDetails(AuthToken token) Future<UserDetails>
Makes a query to the server asking for user details. It gets called when opening the app, and after logging in.
inherited
login(BuildContext context) Future<AuthToken?>
Open a login panel, perform the authentication, and receive a token. Should return null if the process was manually cancelled, or throw an AuthException if it failed.
override
logout(AuthToken token) Future<void>
If needed, inform the server to log the user out.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshToken(AuthToken token) Future<AuthToken>
In case a token can become obsolete, implement this method.
override
testHeaders(Map<String, String>? headers, String? apiKey) Future<bool>
Test the auth credentials. Should return true if they work.
inherited
tokenFromJson(Map<String, dynamic> data) AuthToken
Unpack token retrieved from a secure storage.
override
toString() String
A string representation of this object.
inherited

Operators

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