postAuthorizationCode method

Future<AuthorizationCodeResponse> postAuthorizationCode({
  1. required Uri redirectUri,
  2. required String code,
})

The access token request is the second part of the authorization code flow. When the first part completes, the user's browser is redirected to an application's redirect_uri. This redirect URI also includes an access code and (optionally) a state parameter. This request allows the application to exchange the access code for an access token to can use in subsequent API requests.

redirectUri is the URI to which the user was redirected after authorization. code is the authorization code received from the authorization server.

Returns an AuthorizationCodeResponse containing the access token and other details.

Implementation

Future<AuthorizationCodeResponse> postAuthorizationCode({
  required Uri redirectUri,
  required String code,
}) async {
  return _oauthClient.postAuthorizationCode(
    redirectUri: redirectUri,
    code: code,
  );
}