exchangeAuthorizationCodeForToken method

FutureOr<AuthorizationTokenResponse> exchangeAuthorizationCodeForToken(
  1. Client? client,
  2. String? authCode,
  3. String? redirectUri,
  4. RequestContext req,
  5. ResponseContext res,
)

Exchanges an authorization code for an authorization token.

Implementation

FutureOr<AuthorizationTokenResponse> exchangeAuthorizationCodeForToken(
    Client? client,
    String? authCode,
    String? redirectUri,
    RequestContext req,
    ResponseContext res) {
  throw AuthorizationException(
    ErrorResponse(
      ErrorResponse.unsupportedResponseType,
      'Authorization code grants are not supported.',
      req.uri!.queryParameters['state'] ?? '',
    ),
    statusCode: 400,
  );
}