UpdateCIMDPolicy - Amazon Cognito User Pools
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

UpdateCIMDPolicy

Updates the configuration of a Client ID Metadata Document (CIMD) policy.

Note

Amazon Cognito evaluates AWS Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Request Syntax

{ "CacheDuration": number, "CIMDPolicyId": "string", "ClientId": "string", "PolicyName": "string", "URLPatterns": [ "string" ], "UserPoolId": "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.

CacheDuration

The length of time, in seconds, that Amazon Cognito caches a client metadata document when the document's Cache-Control header doesn't set a max-age between one day and one year. When the header sets a max-age in that range, Amazon Cognito uses the header value instead. The value must be between 86,400 seconds (one day) and 31,556,952 seconds (one year). If you don't set a value, Amazon Cognito keeps the current cache duration.

Type: Integer

Valid Range: Minimum value of 86400. Maximum value of 31556952.

Required: No

CIMDPolicyId

The ID of the CIMD policy that you want to update.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^[a-z0-9]+$

Required: Yes

ClientId

The ID of the app client that you want to associate with the CIMD policy.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [\w+]+

Required: Yes

PolicyName

A friendly name for the CIMD policy. If you don't set a value, Amazon Cognito keeps the current name.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 32.

Pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}\p{Z}]+

Required: No

URLPatterns

One to five HTTPS URL patterns. Amazon Cognito accepts a client ID metadata document URL only when it matches one of these patterns. Each pattern can contain at most one * wildcard, which must replace a whole domain label or path segment. For example, https://*.example.com/client.json or https://client.example.com/cimd/*.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 5 items.

Length Constraints: Minimum length of 12. Maximum length of 256.

Pattern: ^https://[!$-;=@-\[\]_a-z~]+$

Required: Yes

UserPoolId

The ID of the user pool that contains the CIMD policy.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 55.

Pattern: [\w-]+_[0-9a-zA-Z]+

Required: Yes

Response Syntax

{ "CIMDPolicy": { "CacheDuration": number, "CIMDPolicyId": "string", "ClientId": "string", "CreationDate": number, "LastModifiedDate": number, "PolicyName": "string", "URLPatterns": [ "string" ], "UserPoolId": "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.

CIMDPolicy

The updated CIMD policy.

Type: CIMDPolicyType object

Errors

For information about the errors that are common to all actions, see Common Error Types.

ConcurrentModificationException

This exception is thrown if two or more modifications are happening concurrently.

message

The message provided when the concurrent exception is thrown.

HTTP Status Code: 400

FeatureUnavailableInTierException

This exception is thrown when a feature that you attempted to use or configure isn't included in your user pool's current feature plan. This can occur when:

  • You configure a feature that your feature plan doesn't support.

  • You make a request that uses a feature that requires a higher feature plan.

To resolve this issue, upgrade your user pool to a feature plan that includes the feature.

HTTP Status Code: 400

InternalErrorException

This exception is thrown when Amazon Cognito encounters an internal error.

message

The message returned when Amazon Cognito throws an internal error exception.

HTTP Status Code: 500

InvalidParameterException

This exception is thrown when the Amazon Cognito service encounters an invalid parameter.

message

The message returned when the Amazon Cognito service throws an invalid parameter exception.

reasonCode

The reason code of the exception.

HTTP Status Code: 400

LimitExceededException

This exception is thrown when a user exceeds the limit for a requested AWS resource.

message

The message returned when Amazon Cognito throws a limit exceeded exception.

HTTP Status Code: 400

NotAuthorizedException

This exception is thrown when a user isn't authorized.

message

The message returned when the Amazon Cognito service returns a not authorized exception.

HTTP Status Code: 400

OperationNotEnabledException

This exception is thrown when an operation is not available in the current region or for the current user pool configuration. This can occur when attempting to perform operations that are not supported in secondary replica regions.

HTTP Status Code: 400

ResourceNotFoundException

This exception is thrown when the Amazon Cognito service can't find the requested resource.

message

The message returned when the Amazon Cognito service returns a resource not found exception.

HTTP Status Code: 400

TooManyRequestsException

This exception is thrown when the user has made too many requests for a given operation.

message

The message returned when the Amazon Cognito service returns a too many requests exception.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: