requestAccessToken method
Requests and Access Token using the provided Authorization code
.
Implementation
Future<AccessTokenResponse> requestAccessToken(
{required String code,
required String clientId,
String? clientSecret,
String? codeVerifier,
List<String>? scopes,
Map<String, dynamic>? customParams,
httpClient}) async {
final params = getTokenUrlParams(
code: code,
redirectUri: redirectUri,
codeVerifier: codeVerifier,
customParams: customParams);
var response = await _performAuthorizedRequest(
url: tokenUrl,
clientId: clientId,
clientSecret: clientSecret,
params: params,
headers: _accessTokenRequestHeaders,
httpClient: httpClient);
return http2TokenResponse(response, requestedScopes: scopes);
}