AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates and returns access and refresh tokens for clients that are authenticated using client secrets. The access token can be used to fetch short-term credentials for the assigned AWS accounts or to access application APIs using bearer authentication.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginCreateToken and EndCreateToken.

Namespace: Amazon.SSOOIDC
Assembly: AWSSDK.SSOOIDC.dll
Version: 3.x.y.z

Syntax

C#
public abstract Task<CreateTokenResponse> CreateTokenAsync(
         CreateTokenRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.SSOOIDC.Model.CreateTokenRequest

Container for the necessary parameters to execute the CreateToken service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the CreateToken service method, as returned by SSOOIDC.

Exceptions

ExceptionCondition
AccessDeniedException You do not have sufficient access to perform this action.
AuthorizationPendingException Indicates that a request to authorize a client with an access user session token is pending.
ExpiredTokenException Indicates that the token issued by the service is expired and is no longer valid.
InternalServerException Indicates that an error from the service occurred while trying to process a request.
InvalidClientException Indicates that the clientId or clientSecret in the request is invalid. For example, this can occur when a client sends an incorrect clientId or an expired clientSecret.
InvalidGrantException Indicates that a request contains an invalid grant. This can occur if a client makes a CreateToken request with an invalid grant type.
InvalidRequestException Indicates that something is wrong with the input to the request. For example, a required parameter might be missing or out of range.
InvalidScopeException Indicates that the scope provided in the request is invalid.
SlowDownException Indicates that the client is making the request too frequently and is more than the service can handle.
UnauthorizedClientException Indicates that the client is not currently authorized to make the request. This can happen when a clientId is not issued for a public client.
UnsupportedGrantTypeException Indicates that the grant type in the request is not supported by the service.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer

See Also