Amazon Cognito Identity Provider
API Reference (API Version 2016-04-18)

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 with DescribeUserPoolClient.

Important

If you don't provide a value for an attribute, it will be set to the default value.

Request Syntax

{ "AllowedOAuthFlows": [ "string" ], "AllowedOAuthFlowsUserPoolClient": boolean, "AllowedOAuthScopes": [ "string" ], "AnalyticsConfiguration": { "ApplicationId": "string", "ExternalId": "string", "RoleArn": "string", "UserDataShared": boolean }, "CallbackURLs": [ "string" ], "ClientId": "string", "ClientName": "string", "DefaultRedirectURI": "string", "ExplicitAuthFlows": [ "string" ], "LogoutURLs": [ "string" ], "PreventUserExistenceErrors": "string", "ReadAttributes": [ "string" ], "RefreshTokenValidity": number, "SupportedIdentityProviders": [ "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.

AllowedOAuthFlows

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.

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

A list of allowed OAuth scopes. Currently supported values are "phone", "email", "openid", and "Cognito". In addition to these values, 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.

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 the ALLOW_ prefix. Note that values with ALLOW_ prefix cannot be used along with values without ALLOW_ prefix.

Valid values include:

  • ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_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

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 to LEGACY, those APIs will return a UserNotFoundException 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 January 1st 2020, the value of PreventUserExistenceErrors will default to ENABLED 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 3650.

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

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": { "AllowedOAuthFlows": [ "string" ], "AllowedOAuthFlowsUserPoolClient": boolean, "AllowedOAuthScopes": [ "string" ], "AnalyticsConfiguration": { "ApplicationId": "string", "ExternalId": "string", "RoleArn": "string", "UserDataShared": boolean }, "CallbackURLs": [ "string" ], "ClientId": "string", "ClientName": "string", "ClientSecret": "string", "CreationDate": number, "DefaultRedirectURI": "string", "ExplicitAuthFlows": [ "string" ], "LastModifiedDate": number, "LogoutURLs": [ "string" ], "PreventUserExistenceErrors": "string", "ReadAttributes": [ "string" ], "RefreshTokenValidity": number, "SupportedIdentityProviders": [ "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: