UpdateUserPoolClient
Updates the specified user pool app client with the specified attributes. You can get a list of the current user pool app client settings using DescribeUserPoolClient.
If you don't provide a value for an attribute, it will be set to the default value.
Request Syntax
{
"AccessTokenValidity": number
,
"AllowedOAuthFlows": [ "string
" ],
"AllowedOAuthFlowsUserPoolClient": boolean
,
"AllowedOAuthScopes": [ "string
" ],
"AnalyticsConfiguration": {
"ApplicationArn": "string
",
"ApplicationId": "string
",
"ExternalId": "string
",
"RoleArn": "string
",
"UserDataShared": boolean
},
"CallbackURLs": [ "string
" ],
"ClientId": "string
",
"ClientName": "string
",
"DefaultRedirectURI": "string
",
"ExplicitAuthFlows": [ "string
" ],
"IdTokenValidity": number
,
"LogoutURLs": [ "string
" ],
"PreventUserExistenceErrors": "string
",
"ReadAttributes": [ "string
" ],
"RefreshTokenValidity": number
,
"SupportedIdentityProviders": [ "string
" ],
"TokenValidityUnits": {
"AccessToken": "string
",
"IdToken": "string
",
"RefreshToken": "string
"
},
"UserPoolId": "string
",
"WriteAttributes": [ "string
" ]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- AccessTokenValidity
-
The time limit, after which the access token is no longer valid and cannot be used.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 86400.
Required: No
- AllowedOAuthFlows
-
The allowed OAuth flows.
Set to
code
to initiate a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the token endpoint.Set to
implicit
to specify that the client should get the access token (and, optionally, ID token, based on scopes) directly.Set to
client_credentials
to specify that the client should get the access token (and, optionally, ID token, based on scopes) from the token endpoint using a combination of client and client_secret.Type: Array of strings
Array Members: Minimum number of 0 items. Maximum number of 3 items.
Valid Values:
code | implicit | client_credentials
Required: No
- AllowedOAuthFlowsUserPoolClient
-
Set to true if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
Type: Boolean
Required: No
- AllowedOAuthScopes
-
The allowed OAuth scopes. Possible values provided by OAuth are:
phone
,email
,openid
, andprofile
. Possible values provided by AWS are:aws.cognito.signin.user.admin
. Custom scopes created in Resource Servers are also supported.Type: Array of strings
Array Members: Maximum number of 50 items.
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
[\x21\x23-\x5B\x5D-\x7E]+
Required: No
- AnalyticsConfiguration
-
The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
Note In regions where Pinpoint is not available, Cognito User Pools only supports sending events to Amazon Pinpoint projects in us-east-1. In regions where Pinpoint is available, Cognito User Pools will support sending events to Amazon Pinpoint projects within that same region.
Type: AnalyticsConfigurationType object
Required: No
- CallbackURLs
-
A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint
. Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
Type: Array of strings
Array Members: Minimum number of 0 items. Maximum number of 100 items.
Length Constraints: Minimum length of 1. Maximum length of 1024.
Pattern:
[\p{L}\p{M}\p{S}\p{N}\p{P}]+
Required: No
-
- ClientId
-
The ID of the client associated with the user pool.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
[\w+]+
Required: Yes
- ClientName
-
The client name from the update user pool client request.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
[\w\s+=,.@-]+
Required: No
- DefaultRedirectURI
-
The default redirect URI. Must be in the
CallbackURLs
list.A redirect URI must:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint
. Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Pattern:
[\p{L}\p{M}\p{S}\p{N}\p{P}]+
Required: No
-
- ExplicitAuthFlows
-
The authentication flows that are supported by the user pool clients. Flow names without the
ALLOW_
prefix are deprecated in favor of new names with theALLOW_
prefix. Note that values withALLOW_
prefix cannot be used along with values withoutALLOW_
prefix.Valid values include:
-
ALLOW_ADMIN_USER_PASSWORD_AUTH
: Enable admin based user password authentication flowADMIN_USER_PASSWORD_AUTH
. This setting replaces theADMIN_NO_SRP_AUTH
setting. With this authentication flow, Cognito receives the password in the request instead of using the SRP (Secure Remote Password protocol) protocol to verify passwords. -
ALLOW_CUSTOM_AUTH
: Enable Lambda trigger based authentication. -
ALLOW_USER_PASSWORD_AUTH
: Enable user password-based authentication. In this flow, Cognito receives the password in the request instead of using the SRP protocol to verify passwords. -
ALLOW_USER_SRP_AUTH
: Enable SRP based authentication. -
ALLOW_REFRESH_TOKEN_AUTH
: Enable authflow to refresh tokens.
Type: Array of strings
Valid Values:
ADMIN_NO_SRP_AUTH | CUSTOM_AUTH_FLOW_ONLY | USER_PASSWORD_AUTH | ALLOW_ADMIN_USER_PASSWORD_AUTH | ALLOW_CUSTOM_AUTH | ALLOW_USER_PASSWORD_AUTH | ALLOW_USER_SRP_AUTH | ALLOW_REFRESH_TOKEN_AUTH
Required: No
-
- IdTokenValidity
-
The time limit, after which the ID token is no longer valid and cannot be used.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 86400.
Required: No
- LogoutURLs
-
A list of allowed logout URLs for the identity providers.
Type: Array of strings
Array Members: Minimum number of 0 items. Maximum number of 100 items.
Length Constraints: Minimum length of 1. Maximum length of 1024.
Pattern:
[\p{L}\p{M}\p{S}\p{N}\p{P}]+
Required: No
- PreventUserExistenceErrors
-
Use this setting to choose which errors and responses are returned by Cognito APIs during authentication, account confirmation, and password recovery when the user does not exist in the user pool. When set to
ENABLED
and the user does not exist, authentication returns an error indicating either the username or password was incorrect, and account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set toLEGACY
, those APIs will return aUserNotFoundException
exception if the user does not exist in the user pool.Valid values include:
-
ENABLED
- This prevents user existence-related errors. -
LEGACY
- This represents the old behavior of Cognito where user existence related errors are not prevented.
This setting affects the behavior of following APIs:
Note After February 15th 2020, the value of
PreventUserExistenceErrors
will default toENABLED
for newly created user pool clients if no value is provided.Type: String
Valid Values:
LEGACY | ENABLED
Required: No
-
- ReadAttributes
-
The read-only attributes of the user pool.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 2048.
Required: No
- RefreshTokenValidity
-
The time limit, in days, after which the refresh token is no longer valid and cannot be used.
Type: Integer
Valid Range: Minimum value of 0. Maximum value of 315360000.
Required: No
- SupportedIdentityProviders
-
A list of provider names for the identity providers that are supported on this client.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 32.
Pattern:
[\p{L}\p{M}\p{S}\p{N}\p{P}]+
Required: No
- TokenValidityUnits
-
The units in which the validity times are represented in. Default for RefreshToken is days, and default for ID and access tokens are hours.
Type: TokenValidityUnitsType object
Required: No
- UserPoolId
-
The user pool ID for the user pool where you want to update the user pool client.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 55.
Pattern:
[\w-]+_[0-9a-zA-Z]+
Required: Yes
- WriteAttributes
-
The writeable attributes of the user pool.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 2048.
Required: No
Response Syntax
{
"UserPoolClient": {
"AccessTokenValidity": number,
"AllowedOAuthFlows": [ "string" ],
"AllowedOAuthFlowsUserPoolClient": boolean,
"AllowedOAuthScopes": [ "string" ],
"AnalyticsConfiguration": {
"ApplicationArn": "string",
"ApplicationId": "string",
"ExternalId": "string",
"RoleArn": "string",
"UserDataShared": boolean
},
"CallbackURLs": [ "string" ],
"ClientId": "string",
"ClientName": "string",
"ClientSecret": "string",
"CreationDate": number,
"DefaultRedirectURI": "string",
"ExplicitAuthFlows": [ "string" ],
"IdTokenValidity": number,
"LastModifiedDate": number,
"LogoutURLs": [ "string" ],
"PreventUserExistenceErrors": "string",
"ReadAttributes": [ "string" ],
"RefreshTokenValidity": number,
"SupportedIdentityProviders": [ "string" ],
"TokenValidityUnits": {
"AccessToken": "string",
"IdToken": "string",
"RefreshToken": "string"
},
"UserPoolId": "string",
"WriteAttributes": [ "string" ]
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- UserPoolClient
-
The user pool client value from the response from the server when an update user pool client request is made.
Type: UserPoolClientType object
Errors
For information about the errors that are common to all actions, see Common Errors.
- ConcurrentModificationException
-
This exception is thrown if two or more modifications are happening concurrently.
HTTP Status Code: 400
- InternalErrorException
-
This exception is thrown when Amazon Cognito encounters an internal error.
HTTP Status Code: 500
- InvalidOAuthFlowException
-
This exception is thrown when the specified OAuth flow is invalid.
HTTP Status Code: 400
- InvalidParameterException
-
This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
HTTP Status Code: 400
- NotAuthorizedException
-
This exception is thrown when a user is not authorized.
HTTP Status Code: 400
- ResourceNotFoundException
-
This exception is thrown when the Amazon Cognito service cannot find the requested resource.
HTTP Status Code: 400
- ScopeDoesNotExistException
-
This exception is thrown when the specified scope does not exist.
HTTP Status Code: 400
- TooManyRequestsException
-
This exception is thrown when the user has made too many requests for a given operation.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: