OAuth2Flow class Null safety

OAuth2 Flow Helper

Example:

 var flow = new OAuth2Flow('ClientID', 'ClientSecret');
 var authUrl = flow.createAuthorizeUrl();
 // Display to the User and handle the redirect URI, and also get the code.
 flow.exchange(code).then((response) {
   var github = new GitHub(auth: new Authentication.withToken(response.token));
   // Use the GitHub Client
 });

Due to Cross Origin Policy, it is not possible to do this completely client side.

Constructors

OAuth2Flow(String clientId, String clientSecret, {String? redirectUri, List<String> scopes = const [], String? state, GitHub? github, String baseUrl = 'https://github.com/login/oauth'})

Properties

baseUrl String
OAuth2 Base URL
final
clientId String
OAuth2 Client ID
final
clientSecret String
Client Secret
final
github GitHub?
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
redirectUri String?
Redirect URI
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scopes List<String>
Requested Scopes
final
state String?
State
final

Methods

createAuthorizeUrl() String
Generates an Authorization URL [...]
exchange(String code, [String? origin]) Future<ExchangeResponse>
Exchanges the given code for a token.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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