

# CreateOAuth2TokenRequestBody
<a name="API_dataplane-signin_CreateOAuth2TokenRequestBody"></a>

Input structure for the `CreateOAuth2Token` operation.

Contains flattened token operation inputs for both authorization code and refresh token flows. The operation type is determined by the `grant_type` parameter in the request body.

## Contents
<a name="API_dataplane-signin_CreateOAuth2TokenRequestBody_Contents"></a>

 ** clientId **   <a name="signin-Type-dataplane-signin_CreateOAuth2TokenRequestBody-clientId"></a>
Client identifier which is unique to authorization server.  
Type: String  
Pattern: `arn:aws:signin:::devtools/(same-device|cross-device)`   
Required: Yes

 ** grantType **   <a name="signin-Type-dataplane-signin_CreateOAuth2TokenRequestBody-grantType"></a>
Specifies the type of OAuth 2.0 grant being requested. Supported values:  
+  `authorization_code` - Exchange an authorization code for token.
+  `refresh_token` - Use a refresh token to obtain new access token.
Type: String  
Pattern: `(authorization_code|refresh_token)`   
Required: Yes

 ** code **   <a name="signin-Type-dataplane-signin_CreateOAuth2TokenRequestBody-code"></a>
The authorization code received from `/v1/authorize`. Required only when `grant_type=authorization_code`.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Required: No

 ** codeVerifier **   <a name="signin-Type-dataplane-signin_CreateOAuth2TokenRequestBody-codeVerifier"></a>
PKCE code verifier to prove possession of the original code challenge. Required only when `grant_type=authorization_code`.  
Type: String  
Length Constraints: Minimum length of 43. Maximum length of 128.  
Pattern: `[A-Za-z0-9\-._~]+`   
Required: No

 ** redirectUri **   <a name="signin-Type-dataplane-signin_CreateOAuth2TokenRequestBody-redirectUri"></a>
 The redirect URI that must match the original authorization request. Required only when `grant_type=authorization_code`.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: No

 ** refreshToken **   <a name="signin-Type-dataplane-signin_CreateOAuth2TokenRequestBody-refreshToken"></a>
Required only when `grant_type=refresh_token`.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: No

## See Also
<a name="API_dataplane-signin_CreateOAuth2TokenRequestBody_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/signin-2023-01-01/CreateOAuth2TokenRequestBody) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/signin-2023-01-01/CreateOAuth2TokenRequestBody) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/signin-2023-01-01/CreateOAuth2TokenRequestBody) 