authorizeAndExchangeCode method

Future<AuthorizationTokenResponse> authorizeAndExchangeCode({
  1. required String clientID,
  2. required AuthEndpointsData authEndpointsData,
})

Implementation

Future<AuthorizationTokenResponse> authorizeAndExchangeCode({
  required String clientID,
  required AuthEndpointsData authEndpointsData,
}) async {
  AuthorizationTokenRequest tokenRequest = AuthorizationTokenRequest(
    clientID,
    authEndpointsData.redirectUrl,
    discoveryUrl: authEndpointsData.openIDMetadataEndpoint,
    loginHint: authEndpointsData.loginHint,
    serviceConfiguration: _authorizationServiceConfig,
    scopes: authEndpointsData.scopes,
  );

  return await _flutterAppAuth.authorizeAndExchangeCode(tokenRequest);
}