execute method

  1. @override
Future<Client> execute(
  1. OAuthSettings oAuthSettings,
  2. Client client,
  3. CredentialsRefreshedCallback onCredentialsRefreshed
)
override

Execute this AuthorizationStrategy and create an oauth2.Client that is authorized.

Implementation

@override
Future<oauth2.Client> execute(
  OAuthSettings oAuthSettings,
  http.Client client,
  oauth2.CredentialsRefreshedCallback onCredentialsRefreshed,
) {
  return customGrant(
    oAuthSettings.authorizationUri,
    _grantName,
    {'phone_number': phoneNumber, 'token': smsToken},
    identifier: oAuthSettings.clientId,
    secret: oAuthSettings.clientSecret,
    scopes: oAuthSettings.scopes,
    httpClient: client,
    onCredentialsRefreshed: onCredentialsRefreshed,
  );
}