OAuth2Client constructor

OAuth2Client({
  1. required String authorizeUrl,
  2. required String tokenUrl,
  3. String? refreshUrl,
  4. String? revokeUrl,
  5. required String redirectUri,
  6. required String customUriScheme,
  7. CredentialsLocation credentialsLocation = CredentialsLocation.header,
  8. String scopeSeparator = ' ',
})

Creates a new client instance with the following parameters:

  • authorizeUrl: the url that must be used to fetch authorization codes (for Authorization Code flows)
  • tokenUrl: the url to be used for generating the OAuth2 access tokens
  • refreshUrl: the url that must be used for refreshing an Access Token
  • revokeUrl: the url to be invoked for token revocation
  • redirectUri: the redirect uri defined in the provider's client registration panel
  • customUriScheme: the scheme used for the redirect uri
  • credentialsLocation: where the credentials (client ID / client secret) should be passed (header / body)
  • scopeSeparator: the separator that has to be used to serialize scopes in the token request

Implementation

OAuth2Client(
    {required this.authorizeUrl,
    required this.tokenUrl,
    this.refreshUrl,
    this.revokeUrl,
    required this.redirectUri,
    required this.customUriScheme,
    this.credentialsLocation = CredentialsLocation.header,
    this.scopeSeparator = ' '});