OAuth2Client class

Constructors

OAuth2Client({required Uri tokenEndpoint, String? clientId, String? clientSecret, Map<String, String> defaultHeaders = const <String, String>{}, bool useBasicAuth = true, Client? httpClient})

Properties

clientId String?
final
clientSecret String?
final
defaultHeaders Map<String, String>
Headers applied to OAuth requests.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenEndpoint Uri
final
useBasicAuth bool
Whether to use HTTP Basic auth for token exchange.
final

Methods

clientCredentials({String? scope, Map<String, String>? additionalParameters}) Future<OAuthTokenResponse>
exchangeAuthorizationCode({required String code, required Uri redirectUri, String? codeVerifier, String? scope, Map<String, String>? additionalParameters}) Future<OAuthTokenResponse>
fetchUserInfo(Uri endpoint, String accessToken) Future<Map<String, dynamic>>
Loads profile data from the provider userinfo endpoint.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshToken({required String refreshToken, String? scope, Map<String, String>? additionalParameters}) Future<OAuthTokenResponse>
toString() String
A string representation of this object.
inherited

Operators

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