Table of Contents
SSOOIDC.
Client
¶A low-level client representing AWS SSO OIDC
AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC) is a web service that enables a client (such as AWS CLI or a native application) to register with IAM Identity Center. The service also enables the client to fetch the user’s access token upon successful authentication and authorization with IAM Identity Center.
Note
Although AWS Single Sign-On was renamed, thesso
andidentitystore
API namespaces will continue to retain their original name for backward compatibility purposes. For more information, see IAM Identity Center rename.
Considerations for Using This Guide
Before you begin using this guide, we recommend that you first review the following important information about how the IAM Identity Center OIDC service works.
For general information about IAM Identity Center, see What is IAM Identity Center? in the IAM Identity Center User Guide .
import boto3
client = boto3.client('sso-oidc')
These are the available methods:
can_paginate()
close()
create_token()
get_paginator()
get_waiter()
register_client()
start_device_authorization()
can_paginate
(operation_name)¶Check if an operation can be paginated.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.True
if the operation can be paginated,
False
otherwise.close
()¶Closes underlying endpoint connections.
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
get_paginator
(operation_name)¶Create a paginator for an operation.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.client.can_paginate
method to
check if an operation is pageable.get_waiter
(waiter_name)¶Returns an object that can wait for some condition.
register_client
(**kwargs)¶Registers a client with IAM Identity Center. This allows clients to initiate device authorization. The output should be persisted for reuse through many authentication requests.
See also: AWS API Documentation
Request Syntax
response = client.register_client(
clientName='string',
clientType='string',
scopes=[
'string',
]
)
[REQUIRED]
The friendly name of the client.
[REQUIRED]
The type of client. The service supports only public
as a client type. Anything other than public will be rejected by the service.
The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.
dict
Response Syntax
{
'clientId': 'string',
'clientSecret': 'string',
'clientIdIssuedAt': 123,
'clientSecretExpiresAt': 123,
'authorizationEndpoint': 'string',
'tokenEndpoint': 'string'
}
Response Structure
(dict) --
clientId (string) --
The unique identifier string for each client. This client uses this identifier to get authenticated by the service in subsequent calls.
clientSecret (string) --
A secret string generated for the client. The client will use this string to get authenticated by the service in subsequent calls.
clientIdIssuedAt (integer) --
Indicates the time at which the clientId
and clientSecret
were issued.
clientSecretExpiresAt (integer) --
Indicates the time at which the clientId
and clientSecret
will become invalid.
authorizationEndpoint (string) --
The endpoint where the client can request authorization.
tokenEndpoint (string) --
The endpoint where the client can get an access token.
Exceptions
SSOOIDC.Client.exceptions.InvalidRequestException
SSOOIDC.Client.exceptions.InvalidScopeException
SSOOIDC.Client.exceptions.InvalidClientMetadataException
SSOOIDC.Client.exceptions.InternalServerException
Initiates device authorization by requesting a pair of verification codes from the authorization service.
See also: AWS API Documentation
Request Syntax
response = client.start_device_authorization(
clientId='string',
clientSecret='string',
startUrl='string'
)
[REQUIRED]
The unique identifier string for the client that is registered with IAM Identity Center. This value should come from the persisted result of the RegisterClient API operation.
[REQUIRED]
A secret string that is generated for the client. This value should come from the persisted result of the RegisterClient API operation.
[REQUIRED]
The URL for the AWS access portal. For more information, see Using the AWS access portal in the IAM Identity Center User Guide .
dict
Response Syntax
{
'deviceCode': 'string',
'userCode': 'string',
'verificationUri': 'string',
'verificationUriComplete': 'string',
'expiresIn': 123,
'interval': 123
}
Response Structure
(dict) --
deviceCode (string) --
The short-lived code that is used by the device when polling for a session token.
userCode (string) --
A one-time user verification code. This is needed to authorize an in-use device.
verificationUri (string) --
The URI of the verification page that takes the userCode
to authorize the device.
verificationUriComplete (string) --
An alternate URL that the client can use to automatically launch a browser. This process skips the manual step in which the user visits the verification page and enters their code.
expiresIn (integer) --
Indicates the number of seconds in which the verification code will become invalid.
interval (integer) --
Indicates the number of seconds the client must wait between attempts when polling for a session.
Exceptions
SSOOIDC.Client.exceptions.InvalidRequestException
SSOOIDC.Client.exceptions.InvalidClientException
SSOOIDC.Client.exceptions.UnauthorizedClientException
SSOOIDC.Client.exceptions.SlowDownException
SSOOIDC.Client.exceptions.InternalServerException
The available paginators are: