SSOOIDC.Client.
create_token
(**kwargs)¶Creates and returns an access token for the authorized client. The access token issued will be used to fetch short-term credentials for the assigned roles in the AWS account.
See also: AWS API Documentation
Request Syntax
response = client.create_token(
clientId='string',
clientSecret='string',
grantType='string',
deviceCode='string',
code='string',
refreshToken='string',
scope=[
'string',
],
redirectUri='string'
)
[REQUIRED]
The unique identifier string for each client. This value should come from the persisted result of the RegisterClient API.
[REQUIRED]
A secret string generated for the client. This value should come from the persisted result of the RegisterClient API.
[REQUIRED]
Supports grant types for the authorization code, refresh token, and device code request. For device code requests, specify the following value:
urn:ietf:params:oauth:grant-type:device_code
For information about how to obtain the device code, see the StartDeviceAuthorization topic.
Currently, refreshToken
is not yet implemented and is not supported. For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
The token used to obtain an access token in the event that the access token is invalid or expired.
The list of scopes that is defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.
dict
Response Syntax
{
'accessToken': 'string',
'tokenType': 'string',
'expiresIn': 123,
'refreshToken': 'string',
'idToken': 'string'
}
Response Structure
(dict) --
accessToken (string) --
An opaque token to access IAM Identity Center resources assigned to a user.
tokenType (string) --
Used to notify the client that the returned token is an access token. The supported type is BearerToken
.
expiresIn (integer) --
Indicates the time in seconds when an access token will expire.
refreshToken (string) --
Currently, refreshToken
is not yet implemented and is not supported. For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
A token that, if present, can be used to refresh a previously issued access token that might have expired.
idToken (string) --
Currently, idToken
is not yet implemented and is not supported. For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
The identifier of the user that associated with the access token, if present.
Exceptions
SSOOIDC.Client.exceptions.InvalidRequestException
SSOOIDC.Client.exceptions.InvalidClientException
SSOOIDC.Client.exceptions.InvalidGrantException
SSOOIDC.Client.exceptions.UnauthorizedClientException
SSOOIDC.Client.exceptions.UnsupportedGrantTypeException
SSOOIDC.Client.exceptions.InvalidScopeException
SSOOIDC.Client.exceptions.AuthorizationPendingException
SSOOIDC.Client.exceptions.SlowDownException
SSOOIDC.Client.exceptions.AccessDeniedException
SSOOIDC.Client.exceptions.ExpiredTokenException
SSOOIDC.Client.exceptions.InternalServerException