OAuth2Strategy<User> class

An Angel AuthStrategy that signs users in via a third-party service that speaks OAuth 2.0.

Implemented types

Constructors

OAuth2Strategy(ExternalAuthOptions options, Uri authorizationEndpoint, Uri tokenEndpoint, FutureOr<User> verifier(Client, RequestContext, ResponseContext), FutureOr onError(AuthorizationException, RequestContext, ResponseContext), {Map<String, dynamic> getParameters(MediaType, String), String delimiter: ' '})

Properties

authorizationEndpoint Uri
The URL to query to receive an authentication code.
final
delimiter String
An optional delimiter used to send requests to server who does not follow the OAuth 2.0 spec.
final
getParameters Map<String, dynamic> Function(MediaType, String)
An optional callback used to parse the response from a server who does not follow the OAuth 2.0 spec.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
onError FutureOr Function(AuthorizationException, RequestContext, ResponseContext)
A callback that is triggered when an OAuth2 error occurs (i.e. the user declines to login);
final
options ExternalAuthOptions
The options defining how to connect to the third-party.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
tokenEndpoint Uri
The URL to query to exchange an authentication code for a token.
final
verifier FutureOr<User> Function(Client, RequestContext, ResponseContext)
A callback that uses the third-party service to authenticate a User. [...]
final

Methods

authenticate(RequestContext req, ResponseContext res, [AngelAuthOptions<User> options]) FutureOr<User>
Authenticates or rejects an incoming user.
override
authenticateCallback(RequestContext req, ResponseContext res, [AngelAuthOptions options]) Future
The endpoint that is invoked by the third-party after successful authentication.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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