@Generated(value="software.amazon.awssdk:codegen") @ThreadSafe public interface SsoClient extends SdkClient
builder() method.
AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web service that makes it easy for you to assign user access to IAM Identity Center resources such as the AWS access portal. Users can get AWS account applications and roles assigned to them and get federated into the application.
Although AWS Single Sign-On was renamed, the sso and identitystore API namespaces will
continue to retain their original name for backward compatibility purposes. For more information, see IAM Identity Center rename.
This reference guide describes the IAM Identity Center Portal operations that you can call programatically and includes detailed information on data types and errors.
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 IAM Identity Center and other AWS services. For more information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_METADATA_ID
Value for looking up the service's metadata from the
ServiceMetadataProvider. |
static String |
SERVICE_NAME |
| Modifier and Type | Method and Description |
|---|---|
static SsoClientBuilder |
builder()
Create a builder that can be used to configure and create a
SsoClient. |
static SsoClient |
create()
Create a
SsoClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider. |
default GetRoleCredentialsResponse |
getRoleCredentials(Consumer<GetRoleCredentialsRequest.Builder> getRoleCredentialsRequest)
Returns the STS short-term credentials for a given role name that is assigned to the user.
|
default GetRoleCredentialsResponse |
getRoleCredentials(GetRoleCredentialsRequest getRoleCredentialsRequest)
Returns the STS short-term credentials for a given role name that is assigned to the user.
|
default ListAccountRolesResponse |
listAccountRoles(Consumer<ListAccountRolesRequest.Builder> listAccountRolesRequest)
Lists all roles that are assigned to the user for a given AWS account.
|
default ListAccountRolesResponse |
listAccountRoles(ListAccountRolesRequest listAccountRolesRequest)
Lists all roles that are assigned to the user for a given AWS account.
|
default ListAccountRolesIterable |
listAccountRolesPaginator(Consumer<ListAccountRolesRequest.Builder> listAccountRolesRequest)
Lists all roles that are assigned to the user for a given AWS account.
|
default ListAccountRolesIterable |
listAccountRolesPaginator(ListAccountRolesRequest listAccountRolesRequest)
Lists all roles that are assigned to the user for a given AWS account.
|
default ListAccountsResponse |
listAccounts(Consumer<ListAccountsRequest.Builder> listAccountsRequest)
Lists all AWS accounts assigned to the user.
|
default ListAccountsResponse |
listAccounts(ListAccountsRequest listAccountsRequest)
Lists all AWS accounts assigned to the user.
|
default ListAccountsIterable |
listAccountsPaginator(Consumer<ListAccountsRequest.Builder> listAccountsRequest)
Lists all AWS accounts assigned to the user.
|
default ListAccountsIterable |
listAccountsPaginator(ListAccountsRequest listAccountsRequest)
Lists all AWS accounts assigned to the user.
|
default LogoutResponse |
logout(Consumer<LogoutRequest.Builder> logoutRequest)
Removes the locally stored SSO tokens from the client-side cache and sends an API call to the IAM Identity Center
service to invalidate the corresponding server-side IAM Identity Center sign in session.
|
default LogoutResponse |
logout(LogoutRequest logoutRequest)
Removes the locally stored SSO tokens from the client-side cache and sends an API call to the IAM Identity Center
service to invalidate the corresponding server-side IAM Identity Center sign in session.
|
static ServiceMetadata |
serviceMetadata() |
serviceNameclosestatic final String SERVICE_NAME
static final String SERVICE_METADATA_ID
ServiceMetadataProvider.static SsoClient create()
SsoClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider.static SsoClientBuilder builder()
SsoClient.default GetRoleCredentialsResponse getRoleCredentials(GetRoleCredentialsRequest getRoleCredentialsRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
Returns the STS short-term credentials for a given role name that is assigned to the user.
getRoleCredentialsRequest - InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault GetRoleCredentialsResponse getRoleCredentials(Consumer<GetRoleCredentialsRequest.Builder> getRoleCredentialsRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
Returns the STS short-term credentials for a given role name that is assigned to the user.
This is a convenience which creates an instance of the GetRoleCredentialsRequest.Builder avoiding the
need to create one manually via GetRoleCredentialsRequest.builder()
getRoleCredentialsRequest - A Consumer that will call methods on GetRoleCredentialsRequest.Builder to create a
request.InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListAccountRolesResponse listAccountRoles(ListAccountRolesRequest listAccountRolesRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
Lists all roles that are assigned to the user for a given AWS account.
listAccountRolesRequest - InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListAccountRolesResponse listAccountRoles(Consumer<ListAccountRolesRequest.Builder> listAccountRolesRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
Lists all roles that are assigned to the user for a given AWS account.
This is a convenience which creates an instance of the ListAccountRolesRequest.Builder avoiding the need
to create one manually via ListAccountRolesRequest.builder()
listAccountRolesRequest - A Consumer that will call methods on ListAccountRolesRequest.Builder to create a request.InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListAccountRolesIterable listAccountRolesPaginator(ListAccountRolesRequest listAccountRolesRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
Lists all roles that are assigned to the user for a given AWS account.
This is a variant of listAccountRoles(software.amazon.awssdk.services.sso.model.ListAccountRolesRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
internally handle making service calls for you.
When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
for (software.amazon.awssdk.services.sso.model.ListAccountRolesResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listAccountRoles(software.amazon.awssdk.services.sso.model.ListAccountRolesRequest) operation.
listAccountRolesRequest - InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListAccountRolesIterable listAccountRolesPaginator(Consumer<ListAccountRolesRequest.Builder> listAccountRolesRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
Lists all roles that are assigned to the user for a given AWS account.
This is a variant of listAccountRoles(software.amazon.awssdk.services.sso.model.ListAccountRolesRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
internally handle making service calls for you.
When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
for (software.amazon.awssdk.services.sso.model.ListAccountRolesResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listAccountRoles(software.amazon.awssdk.services.sso.model.ListAccountRolesRequest) operation.
This is a convenience which creates an instance of the ListAccountRolesRequest.Builder avoiding the need
to create one manually via ListAccountRolesRequest.builder()
listAccountRolesRequest - A Consumer that will call methods on ListAccountRolesRequest.Builder to create a request.InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListAccountsResponse listAccounts(ListAccountsRequest listAccountsRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
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 IAM Identity Center User Guide. This operation returns a paginated response.
listAccountsRequest - InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListAccountsResponse listAccounts(Consumer<ListAccountsRequest.Builder> listAccountsRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
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 IAM Identity Center User Guide. This operation returns a paginated response.
This is a convenience which creates an instance of the ListAccountsRequest.Builder avoiding the need to
create one manually via ListAccountsRequest.builder()
listAccountsRequest - A Consumer that will call methods on ListAccountsRequest.Builder to create a request.InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListAccountsIterable listAccountsPaginator(ListAccountsRequest listAccountsRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
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 IAM Identity Center User Guide. This operation returns a paginated response.
This is a variant of listAccounts(software.amazon.awssdk.services.sso.model.ListAccountsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
internally handle making service calls for you.
When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
for (software.amazon.awssdk.services.sso.model.ListAccountsResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listAccounts(software.amazon.awssdk.services.sso.model.ListAccountsRequest) operation.
listAccountsRequest - InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListAccountsIterable listAccountsPaginator(Consumer<ListAccountsRequest.Builder> listAccountsRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException, SsoException
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 IAM Identity Center User Guide. This operation returns a paginated response.
This is a variant of listAccounts(software.amazon.awssdk.services.sso.model.ListAccountsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
internally handle making service calls for you.
When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
for (software.amazon.awssdk.services.sso.model.ListAccountsResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listAccounts(software.amazon.awssdk.services.sso.model.ListAccountsRequest) operation.
This is a convenience which creates an instance of the ListAccountsRequest.Builder avoiding the need to
create one manually via ListAccountsRequest.builder()
listAccountsRequest - A Consumer that will call methods on ListAccountsRequest.Builder to create a request.InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.ResourceNotFoundException - The specified resource doesn't exist.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault LogoutResponse logout(LogoutRequest logoutRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, AwsServiceException, SdkClientException, SsoException
Removes the locally stored SSO tokens from the client-side cache and sends an API call to the IAM Identity Center service to invalidate the corresponding server-side IAM Identity Center sign in session.
If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM Identity Center sign in session is used to obtain an IAM session, as specified in the corresponding IAM Identity Center permission set. More specifically, IAM Identity Center assumes an IAM role in the target account on behalf of the user, and the corresponding temporary AWS credentials are returned to the client.
After user logout, any existing IAM role sessions that were created by using IAM Identity Center permission sets continue based on the duration configured in the permission set. For more information, see User authentications in the IAM Identity Center User Guide.
logoutRequest - InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault LogoutResponse logout(Consumer<LogoutRequest.Builder> logoutRequest) throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, AwsServiceException, SdkClientException, SsoException
Removes the locally stored SSO tokens from the client-side cache and sends an API call to the IAM Identity Center service to invalidate the corresponding server-side IAM Identity Center sign in session.
If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM Identity Center sign in session is used to obtain an IAM session, as specified in the corresponding IAM Identity Center permission set. More specifically, IAM Identity Center assumes an IAM role in the target account on behalf of the user, and the corresponding temporary AWS credentials are returned to the client.
After user logout, any existing IAM role sessions that were created by using IAM Identity Center permission sets continue based on the duration configured in the permission set. For more information, see User authentications in the IAM Identity Center User Guide.
This is a convenience which creates an instance of the LogoutRequest.Builder avoiding the need to create
one manually via LogoutRequest.builder()
logoutRequest - A Consumer that will call methods on LogoutRequest.Builder to create a request.InvalidRequestException - Indicates that a problem occurred with the input to the request. For example, a required parameter might
be missing or out of range.UnauthorizedException - Indicates that the request is not authorized. This can happen due to an invalid access token in the
request.TooManyRequestsException - Indicates that the request is being made too frequently and is more than what the server can handle.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.SsoException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptionstatic ServiceMetadata serviceMetadata()
Copyright © 2023. All rights reserved.