Table of Contents
A low-level client representing AWS Single Sign-On (SSO)
AWS Single Sign-On Portal is a web service that makes it easy for you to assign user access to AWS SSO resources such as the user portal. Users can get AWS account applications and roles assigned to them and get federated into the application.
For general information about AWS SSO, see What is AWS Single Sign-On? in the AWS SSO User Guide .
This API reference guide describes the AWS SSO Portal operations that you can call programatically and includes detailed information on data types and errors.
Note
AWS provides SDKs that consist of libraries and sample code for various programming languages and platforms, such as Java, Ruby, .Net, iOS, or Android. The SDKs provide a convenient way to create programmatic access to AWS SSO and other AWS services. For more information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services .
import boto3
client = boto3.client('sso')
These are the available methods:
Check if an operation can be paginated.
Create a paginator for an operation.
Returns the STS short-term credentials for a given role name that is assigned to the user.
See also: AWS API Documentation
Request Syntax
response = client.get_role_credentials(
roleName='string',
accountId='string',
accessToken='string'
)
[REQUIRED]
The friendly name of the role that is assigned to the user.
[REQUIRED]
The identifier for the AWS account that is assigned to the user.
[REQUIRED]
The token issued by the CreateToken API call. For more information, see CreateToken in the AWS SSO OIDC API Reference Guide .
dict
Response Syntax
{
'roleCredentials': {
'accessKeyId': 'string',
'secretAccessKey': 'string',
'sessionToken': 'string',
'expiration': 123
}
}
Response Structure
(dict) --
roleCredentials (dict) --
The credentials for the role that is assigned to the user.
accessKeyId (string) --
The identifier used for the temporary security credentials. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the AWS IAM User Guide .
secretAccessKey (string) --
The key that is used to sign the request. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the AWS IAM User Guide .
sessionToken (string) --
The token used for temporary credentials. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the AWS IAM User Guide .
expiration (integer) --
The date on which temporary security credentials expire.
Exceptions
Returns an object that can wait for some condition.
Lists all roles that are assigned to the user for a given AWS account.
See also: AWS API Documentation
Request Syntax
response = client.list_account_roles(
nextToken='string',
maxResults=123,
accessToken='string',
accountId='string'
)
[REQUIRED]
The token issued by the CreateToken API call. For more information, see CreateToken in the AWS SSO OIDC API Reference Guide .
[REQUIRED]
The identifier for the AWS account that is assigned to the user.
dict
Response Syntax
{
'nextToken': 'string',
'roleList': [
{
'roleName': 'string',
'accountId': 'string'
},
]
}
Response Structure
(dict) --
nextToken (string) --
The page token client that is used to retrieve the list of accounts.
roleList (list) --
A paginated response with the list of roles and the next token if more results are available.
(dict) --
Provides information about the role that is assigned to the user.
roleName (string) --
The friendly name of the role that is assigned to the user.
accountId (string) --
The identifier of the AWS account assigned to the user.
Exceptions
Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the administrator of the account. For more information, see Assign User Access in the AWS SSO User Guide . This operation returns a paginated response.
See also: AWS API Documentation
Request Syntax
response = client.list_accounts(
nextToken='string',
maxResults=123,
accessToken='string'
)
[REQUIRED]
The token issued by the CreateToken API call. For more information, see CreateToken in the AWS SSO OIDC API Reference Guide .
dict
Response Syntax
{
'nextToken': 'string',
'accountList': [
{
'accountId': 'string',
'accountName': 'string',
'emailAddress': 'string'
},
]
}
Response Structure
(dict) --
nextToken (string) --
The page token client that is used to retrieve the list of accounts.
accountList (list) --
A paginated response with the list of account information and the next token if more results are available.
(dict) --
Provides information about your AWS account.
accountId (string) --
The identifier of the AWS account that is assigned to the user.
accountName (string) --
The display name of the AWS account that is assigned to the user.
emailAddress (string) --
The email address of the AWS account that is assigned to the user.
Exceptions
Removes the client- and server-side session that is associated with the user.
See also: AWS API Documentation
Request Syntax
response = client.logout(
accessToken='string'
)
[REQUIRED]
The token issued by the CreateToken API call. For more information, see CreateToken in the AWS SSO OIDC API Reference Guide .
Exceptions
The available paginators are:
paginator = client.get_paginator('list_account_roles')
Creates an iterator that will paginate through responses from SSO.Client.list_account_roles().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
accessToken='string',
accountId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The token issued by the CreateToken API call. For more information, see CreateToken in the AWS SSO OIDC API Reference Guide .
[REQUIRED]
The identifier for the AWS account that is assigned to the user.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'roleList': [
{
'roleName': 'string',
'accountId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
roleList (list) --
A paginated response with the list of roles and the next token if more results are available.
(dict) --
Provides information about the role that is assigned to the user.
roleName (string) --
The friendly name of the role that is assigned to the user.
accountId (string) --
The identifier of the AWS account assigned to the user.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_accounts')
Creates an iterator that will paginate through responses from SSO.Client.list_accounts().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
accessToken='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The token issued by the CreateToken API call. For more information, see CreateToken in the AWS SSO OIDC API Reference Guide .
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'accountList': [
{
'accountId': 'string',
'accountName': 'string',
'emailAddress': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
accountList (list) --
A paginated response with the list of account information and the next token if more results are available.
(dict) --
Provides information about your AWS account.
accountId (string) --
The identifier of the AWS account that is assigned to the user.
accountName (string) --
The display name of the AWS account that is assigned to the user.
emailAddress (string) --
The email address of the AWS account that is assigned to the user.
NextToken (string) --
A token to resume pagination.