AWS SSO OIDC 2019-06-10
- Client: Aws\SSOOIDC\SSOOIDCClient
- Service ID: sso-oidc
- Version: 2019-06-10
This page describes the parameters and results for the operations of the AWS SSO OIDC (2019-06-10), and shows how to use the Aws\SSOOIDC\SSOOIDCClient object to call the described operations. This documentation is specific to the 2019-06-10 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- CreateToken ( array $params = [] )
Creates and returns an access token for the authorized client.
- RegisterClient ( array $params = [] )
Registers a client with AWS SSO.
- StartDeviceAuthorization ( array $params = [] )
Initiates device authorization by requesting a pair of verification codes from the authorization service.
Operations
CreateToken
$result = $client->createToken
([/* ... */]); $promise = $client->createTokenAsync
([/* ... */]);
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.
Parameter Syntax
$result = $client->createToken([ 'clientId' => '<string>', // REQUIRED 'clientSecret' => '<string>', // REQUIRED 'code' => '<string>', 'deviceCode' => '<string>', // REQUIRED 'grantType' => '<string>', // REQUIRED 'redirectUri' => '<string>', 'refreshToken' => '<string>', 'scope' => ['<string>', ...], ]);
Parameter Details
Members
- clientId
-
- Required: Yes
- Type: string
The unique identifier string for each client. This value should come from the persisted result of the RegisterClient API.
- clientSecret
-
- Required: Yes
- Type: string
A secret string generated for the client. This value should come from the persisted result of the RegisterClient API.
- code
-
- Type: string
The authorization code received from the authorization service. This parameter is required to perform an authorization grant request to get access to a token.
- deviceCode
-
- Required: Yes
- Type: string
Used only when calling this API for the device code grant type. This short-term code is used to identify this authentication attempt. This should come from an in-memory reference to the result of the StartDeviceAuthorization API.
- grantType
-
- Required: Yes
- Type: string
Supports grant types for authorization code, refresh token, and device code request.
- redirectUri
-
- Type: string
The location of the application that will receive the authorization code. Users authorize the service to send the request to this location.
- refreshToken
-
- Type: string
The token used to obtain an access token in the event that the access token is invalid or expired. This token is not issued by the service.
- scope
-
- Type: Array of strings
The list of scopes that is defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.
Result Syntax
[ 'accessToken' => '<string>', 'expiresIn' => <integer>, 'idToken' => '<string>', 'refreshToken' => '<string>', 'tokenType' => '<string>', ]
Result Details
Members
- accessToken
-
- Type: string
An opaque token to access AWS SSO resources assigned to a user.
- expiresIn
-
- Type: int
Indicates the time in seconds when an access token will expire.
- idToken
-
- Type: string
The identifier of the user that associated with the access token, if present.
- refreshToken
-
- Type: string
A token that, if present, can be used to refresh a previously issued access token that might have expired.
- tokenType
-
- Type: string
Used to notify the client that the returned token is an access token. The supported type is
BearerToken
.
Errors
-
Indicates that something is wrong with the input to the request. For example, a required parameter might be missing or out of range.
-
Indicates that the
clientId
orclientSecret
in the request is invalid. For example, this can occur when a client sends an incorrectclientId
or an expiredclientSecret
. -
Indicates that a request contains an invalid grant. This can occur if a client makes a CreateToken request with an invalid grant type.
-
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.
-
Indicates that the scope provided in the request is invalid.
-
AuthorizationPendingException:
Indicates that a request to authorize a client with an access user session token is pending.
-
Indicates that the client is making the request too frequently and is more than the service can handle.
-
You do not have sufficient access to perform this action.
-
Indicates that the token issued by the service is expired and is no longer valid.
-
Indicates that an error from the service occurred while trying to process a request.
RegisterClient
$result = $client->registerClient
([/* ... */]); $promise = $client->registerClientAsync
([/* ... */]);
Registers a client with AWS SSO. This allows clients to initiate device authorization. The output should be persisted for reuse through many authentication requests.
Parameter Syntax
$result = $client->registerClient([ 'clientName' => '<string>', // REQUIRED 'clientType' => '<string>', // REQUIRED 'scopes' => ['<string>', ...], ]);
Parameter Details
Members
- clientName
-
- Required: Yes
- Type: string
The friendly name of the client.
- clientType
-
- Required: Yes
- Type: string
The type of client. The service supports only
public
as a client type. Anything other than public will be rejected by the service. - scopes
-
- Type: Array of strings
The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.
Result Syntax
[ 'authorizationEndpoint' => '<string>', 'clientId' => '<string>', 'clientIdIssuedAt' => <integer>, 'clientSecret' => '<string>', 'clientSecretExpiresAt' => <integer>, 'tokenEndpoint' => '<string>', ]
Result Details
Members
- authorizationEndpoint
-
- Type: string
The endpoint where the client can request authorization.
- clientId
-
- Type: string
The unique identifier string for each client. This client uses this identifier to get authenticated by the service in subsequent calls.
- clientIdIssuedAt
-
- Type: long (int|float)
Indicates the time at which the
clientId
andclientSecret
were issued. - clientSecret
-
- Type: string
A secret string generated for the client. The client will use this string to get authenticated by the service in subsequent calls.
- clientSecretExpiresAt
-
- Type: long (int|float)
Indicates the time at which the
clientId
andclientSecret
will become invalid. - tokenEndpoint
-
- Type: string
The endpoint where the client can get an access token.
Errors
-
Indicates that something is wrong with the input to the request. For example, a required parameter might be missing or out of range.
-
Indicates that the scope provided in the request is invalid.
-
InvalidClientMetadataException:
Indicates that the client information sent in the request during registration is invalid.
-
Indicates that an error from the service occurred while trying to process a request.
StartDeviceAuthorization
$result = $client->startDeviceAuthorization
([/* ... */]); $promise = $client->startDeviceAuthorizationAsync
([/* ... */]);
Initiates device authorization by requesting a pair of verification codes from the authorization service.
Parameter Syntax
$result = $client->startDeviceAuthorization([ 'clientId' => '<string>', // REQUIRED 'clientSecret' => '<string>', // REQUIRED 'startUrl' => '<string>', // REQUIRED ]);
Parameter Details
Members
- clientId
-
- Required: Yes
- Type: string
The unique identifier string for the client that is registered with AWS SSO. This value should come from the persisted result of the RegisterClient API operation.
- clientSecret
-
- Required: Yes
- Type: string
A secret string that is generated for the client. This value should come from the persisted result of the RegisterClient API operation.
- startUrl
-
- Required: Yes
- Type: string
The URL for the AWS SSO user portal. For more information, see Using the User Portal in the AWS Single Sign-On User Guide.
Result Syntax
[ 'deviceCode' => '<string>', 'expiresIn' => <integer>, 'interval' => <integer>, 'userCode' => '<string>', 'verificationUri' => '<string>', 'verificationUriComplete' => '<string>', ]
Result Details
Members
- deviceCode
-
- Type: string
The short-lived code that is used by the device when polling for a session token.
- expiresIn
-
- Type: int
Indicates the number of seconds in which the verification code will become invalid.
- interval
-
- Type: int
Indicates the number of seconds the client must wait between attempts when polling for a session.
- userCode
-
- Type: string
A one-time user verification code. This is needed to authorize an in-use device.
- verificationUri
-
- Type: string
The URI of the verification page that takes the
userCode
to authorize the device. - verificationUriComplete
-
- Type: 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.
Errors
-
Indicates that something is wrong with the input to the request. For example, a required parameter might be missing or out of range.
-
Indicates that the
clientId
orclientSecret
in the request is invalid. For example, this can occur when a client sends an incorrectclientId
or an expiredclientSecret
. -
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. -
Indicates that the client is making the request too frequently and is more than the service can handle.
-
Indicates that an error from the service occurred while trying to process a request.
Shapes
AccessDeniedException
Description
You do not have sufficient access to perform this action.
Members
AuthorizationPendingException
Description
Indicates that a request to authorize a client with an access user session token is pending.
Members
ExpiredTokenException
Description
Indicates that the token issued by the service is expired and is no longer valid.
Members
InternalServerException
Description
Indicates that an error from the service occurred while trying to process a request.
Members
InvalidClientException
Description
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
.
Members
InvalidClientMetadataException
Description
Indicates that the client information sent in the request during registration is invalid.
Members
InvalidGrantException
Description
Indicates that a request contains an invalid grant. This can occur if a client makes a CreateToken request with an invalid grant type.
Members
InvalidRequestException
Description
Indicates that something is wrong with the input to the request. For example, a required parameter might be missing or out of range.
Members
InvalidScopeException
Description
Indicates that the scope provided in the request is invalid.
Members
SlowDownException
Description
Indicates that the client is making the request too frequently and is more than the service can handle.
Members
UnauthorizedClientException
Description
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.