SignInService / Client / create_bearer_token
create_bearer_token¶
- SignInService.Client.create_bearer_token(**kwargs)¶
Creates a bearer token that represents your IAM credentials and can be used to access a supported AWS service. By default, the token is valid for 12 hours.
See also: AWS API Documentation
Request Syntax
response = client.create_bearer_token( grantType='string', resource='string', durationSeconds=123 )
- Parameters:
grantType (string) –
[REQUIRED]
The grant type. Must be “client_credentials”.
resource (string) –
[REQUIRED]
The AWS service the bearer token is for. Example: “ecr.amazonaws.com”.
durationSeconds (integer) – The requested token lifetime in seconds, from 300 (5 minutes) up to the maximum allowed for the service, currently 43200 (12 hours). If omitted, the token is valid for 12 hours.
- Return type:
dict
- Returns:
Response Syntax
{ 'accessToken': 'string', 'tokenType': 'string', 'expiresIn': 123 }
Response Structure
(dict) –
Output structure for CreateBearerToken operation
Contains the bearer token, its type, and its lifetime.
accessToken (string) –
The bearer token. Present it to the AWS service named in the request.
tokenType (string) –
The token type. Always “Bearer”.
expiresIn (integer) –
Token lifetime in seconds.
Exceptions