getTokenUrlParams method
Returns the parameters needed for the authorization code request
Implementation
Map<String, dynamic> getTokenUrlParams(
{required String code,
String? redirectUri,
String? codeVerifier,
Map<String, dynamic>? customParams}) {
final params = <String, dynamic>{
'grant_type': 'authorization_code',
'code': code
};
if (redirectUri != null && redirectUri.isNotEmpty) {
params['redirect_uri'] = redirectUri;
}
/*
//If a client secret has been specified, it will be sent in the "Authorization" header instead of a body parameter...
if (clientSecret == null || clientSecret.isEmpty) {
if (clientId != null && clientId.isNotEmpty) {
params['client_id'] = clientId;
}
}
*/
if (codeVerifier != null && codeVerifier.isNotEmpty) {
params['code_verifier'] = codeVerifier;
}
if (customParams != null) {
params.addAll(customParams);
}
return params;
}