handle method

  1. @override
Future<String> handle(
  1. Uri authorizationEndpoint,
  2. String identifier, {
  3. String? secret,
  4. Client? httpClient,
  5. Iterable<String>? scopes,
  6. bool basicAuth = true,
  7. String? delimiter,
  8. Map<String, dynamic> getParameters(
    1. MediaType? contentType,
    2. String body
    )?,
})
override

Obtains credentials from an authorization server.

Implementation

@override
Future<String> handle(
  Uri authorizationEndpoint,
  String identifier, {
  String? secret,
  http.Client? httpClient,
  Iterable<String>? scopes,
  bool basicAuth = true,
  String? delimiter,
  Map<String, dynamic> Function(MediaType? contentType, String body)?
      getParameters,
}) async {
  final client = await oauth2.resourceOwnerPasswordGrant(
    authorizationEndpoint,
    username,
    password,
    secret: secret,
    identifier: identifier,
    scopes: scopes,
    basicAuth: basicAuth,
    delimiter: delimiter,
    httpClient: httpClient,
    getParameters: getParameters,
    onCredentialsRefreshed: onCredentialsRefreshed,
  );
  return client.credentials.toJson();
}