SignInService / Client / create_oauth2_token_with_iam
create_oauth2_token_with_iam¶
- SignInService.Client.create_oauth2_token_with_iam(**kwargs)¶
Exchanges client credentials for an OAuth 2.0 access token scoped to a resource, which you can use to access AWS services from applications.
See also: AWS API Documentation
Request Syntax
response = client.create_oauth2_token_with_iam( grantType='string', resource='string' )
- Parameters:
grantType (string) –
[REQUIRED]
The OAuth 2.0 grant type. Must be “client_credentials”.
resource (string) –
[REQUIRED]
The OAuth resource for which the access token is requested. Example: “aws-mcp.amazonaws.com”.
- Return type:
dict
- Returns:
Response Syntax
{ 'accessToken': 'string', 'tokenType': 'string', 'expiresIn': 123 }
Response Structure
(dict) –
Output structure for CreateOAuth2TokenWithIAM operation
Contains the access token, token type, and expiration as defined in RFC 6749 §5.1.
accessToken (string) –
Access token containing principal identity, resource scope, and session metadata.
tokenType (string) –
The token type. Always “Bearer” as defined in RFC 6749.
expiresIn (integer) –
Token lifetime in seconds. Value is the minimum of the caller’s session validity and 1 hour (3600 seconds).
Exceptions