update_user_pool_client
async
¶
update_user_pool_client(
user_pool_id: UserPoolIdType,
client_id: ClientIdType,
*,
config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
client_name: Optional[ClientNameType] = None,
refresh_token_validity: Optional[RefreshTokenValidityType] = None,
access_token_validity: Optional[AccessTokenValidityType] = None,
id_token_validity: Optional[IdTokenValidityType] = None,
token_validity_units: Optional[TokenValidityUnitsType] = None,
read_attributes: Optional[ClientPermissionListType] = None,
write_attributes: Optional[ClientPermissionListType] = None,
explicit_auth_flows: Optional[ExplicitAuthFlowsListType] = None,
supported_identity_providers: Optional[SupportedIdentityProvidersListType] = None,
callback_ur_ls: Optional[CallbackURLsListType] = None,
logout_ur_ls: Optional[LogoutURLsListType] = None,
default_redirect_uri: Optional[RedirectUrlType] = None,
allowed_o_auth_flows: Optional[OAuthFlowsType] = None,
allowed_o_auth_scopes: Optional[ScopeListType] = None,
allowed_o_auth_flows_user_pool_client: Optional[BooleanType] = None,
analytics_configuration: Optional[AnalyticsConfigurationType] = None,
prevent_user_existence_errors: Optional[PreventUserExistenceErrorTypes] = None,
enable_token_revocation: Optional[WrappedBooleanType] = None,
enable_propagate_additional_user_context_data: Optional[WrappedBooleanType] = None,
auth_session_validity: Optional[AuthSessionValidityType] = None,
refresh_token_rotation: Optional[RefreshTokenRotationType] = None,
publish_secrets_in_aws_secrets_manager: Optional[WrappedBooleanType] = None,
) -> UpdateUserPoolClientResponse
Given a user pool app client ID, updates the configuration. To avoid setting parameters to Amazon Cognito defaults, construct this API request to pass the existing configuration of your app client, modified to include the changes that you want to make.
If you don't provide a value for an attribute, Amazon Cognito sets it to its default value.
Unlike app clients created in the console, Amazon Cognito doesn't automatically assign a branding style to app clients that you configure with this API operation. Managed login and classic hosted UI pages aren't available for your client until after you apply a branding style.
Amazon Cognito evaluates 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.
Learn more
Parameters:
-
user_pool_id(UserPoolIdType) –The ID of the user pool where you want to update the app client.
-
client_id(ClientIdType) –The ID of the app client that you want to update.
-
client_name(Optional[ClientNameType], default:None) –A friendly name for the app client.
-
refresh_token_validity(Optional[RefreshTokenValidityType], default:None) –The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for
RefreshTokenValidityasseconds,minutes,hours, ordays, set aTokenValidityUnitsvalue in your API request.For example, when you set
RefreshTokenValidityas10andTokenValidityUnitsasdays, your user can refresh their session and retrieve new access and ID tokens for 10 days.The default time unit for
RefreshTokenValidityin an API request is days. You can't setRefreshTokenValidityto 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. Valid range is displayed below in seconds.If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days.
-
access_token_validity(Optional[AccessTokenValidityType], default:None) –The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for
AccessTokenValidityasseconds,minutes,hours, ordays, set aTokenValidityUnitsvalue in your API request.For example, when you set
AccessTokenValidityto10andTokenValidityUnitstohours, your user can authorize access with their access token for 10 hours.The default time unit for
AccessTokenValidityin an API request is hours. Valid range is displayed below in seconds.If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour.
-
id_token_validity(Optional[IdTokenValidityType], default:None) –The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for
IdTokenValidityasseconds,minutes,hours, ordays, set aTokenValidityUnitsvalue in your API request.For example, when you set
IdTokenValidityas10andTokenValidityUnitsashours, your user can authenticate their session with their ID token for 10 hours.The default time unit for
IdTokenValidityin an API request is hours. Valid range is displayed below in seconds.If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour.
-
token_validity_units(Optional[TokenValidityUnitsType], default:None) –The units that validity times are represented in. The default unit for refresh tokens is days, and the default for ID and access tokens are hours.
-
read_attributes(Optional[ClientPermissionListType], default:None) –The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list.
When you don't specify the
ReadAttributesfor your app client, your app can read the values ofemail_verified,phone_number_verified, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes,ReadAttributesdoesn't return any information. Amazon Cognito only populatesReadAttributesin the API response if you have specified your own custom set of read attributes. -
write_attributes(Optional[ClientPermissionListType], default:None) –The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list.
When you don't specify the
WriteAttributesfor your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes,WriteAttributesdoesn't return any information. Amazon Cognito only populatesWriteAttributesin the API response if you have specified your own custom set of write attributes.If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool.
-
explicit_auth_flows(Optional[ExplicitAuthFlowsListType], default:None) –The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions.
If you don't specify a value for
ExplicitAuthFlows, your app client supportsALLOW_REFRESH_TOKEN_AUTH,ALLOW_USER_SRP_AUTH, andALLOW_CUSTOM_AUTH.The values for authentication flow options include the following.
-
ALLOW_USER_AUTH: Enable selection-based sign-in withUSER_AUTH. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without otherExplicitAuthFlowspermitting them. For example users can complete an SRP challenge throughUSER_AUTHwithout the flowUSER_SRP_AUTHbeing active for the app client. This flow doesn't includeCUSTOM_AUTH.To activate this setting, your user pool must be in the Essentials tier or higher.
-
ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication flowADMIN_USER_PASSWORD_AUTH. This setting replaces theADMIN_NO_SRP_AUTHsetting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password. -
ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication. -
ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. In this flow, Amazon 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. -
ALLOW_TOKEN_EXCHANGE_IMPERSONATION– Use this flow to requestGetDerivedTokentoken exchanges without anActorToken. The issued token represents the subject user directly. -
ALLOW_TOKEN_EXCHANGE_DELEGATION– Use this flow to requestGetDerivedTokentoken exchanges that include anActorToken. The issued token carries anactclaim that identifies the intermediary acting on the behalf of the subject.
In some environments, you will see the values
ADMIN_NO_SRP_AUTH,CUSTOM_AUTH_FLOW_ONLY, orUSER_PASSWORD_AUTH. You can't assign these legacyExplicitAuthFlowsvalues to user pool clients at the same time as values that begin withALLOW_, likeALLOW_USER_SRP_AUTH. -
-
supported_identity_providers(Optional[SupportedIdentityProvidersListType], default:None) –A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported:
COGNITO,Facebook,Google,SignInWithApple, andLoginWithAmazon. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for exampleMySAMLIdPorMyOIDCIdP.This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of
COGNITOfrom this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule. -
callback_ur_ls(Optional[CallbackURLsListType], default:None) –A list of allowed redirect, or callback, URLs for managed login authentication. These URLs are the paths where you want to send your users' browsers after they complete authentication with managed login or a third-party IdP. Typically, callback URLs are the home of an application that uses OAuth or OIDC libraries to process authentication outcomes.
A redirect URI must meet the following requirements:
-
Be an absolute URI.
-
Be registered with the authorization server. Amazon Cognito doesn't accept authorization requests with
redirect_urivalues that aren't in the list ofCallbackURLsthat you provide in this parameter. -
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://exampleare also supported. -
-
logout_ur_ls(Optional[LogoutURLsListType], default:None) –A list of allowed logout URLs for managed login authentication. When you pass
logout_uriandclient_idparameters to/logout, Amazon Cognito signs out your user and redirects them to the logout URL. This parameter describes the URLs that you want to be the permitted targets oflogout_uri. A typical use of these URLs is when a user selects "Sign out" and you redirect them to your public homepage. For more information, see Logout endpoint. -
default_redirect_uri(Optional[RedirectUrlType], default:None) –The default redirect URI. In app clients with one assigned IdP, replaces
redirect_uriin authentication requests. Must be in theCallbackURLslist. -
allowed_o_auth_flows(Optional[OAuthFlowsType], default:None) –The OAuth grant types that you want your app client to generate. To create an app client that generates client credentials grants, you must add
client_credentialsas the only allowed OAuth flow.- code
-
Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the
/oauth2/tokenendpoint. - implicit
-
Issue the access token (and, optionally, ID token, based on scopes) directly to your user.
- client_credentials
-
Issue the access token from the
/oauth2/tokenendpoint directly to a non-person user using a combination of the client ID and client secret.
-
allowed_o_auth_scopes(Optional[ScopeListType], default:None) –The OAuth, OpenID Connect (OIDC), and custom scopes that you want to permit your app client to authorize access with. Scopes govern access control to user pool self-service API operations, user data from the
userInfoendpoint, and third-party APIs. Scope values includephone,email,openid, andprofile. Theaws.cognito.signin.user.adminscope authorizes user self-service operations. Custom scopes with resource servers authorize access to external APIs. -
allowed_o_auth_flows_user_pool_client(Optional[BooleanType], default:None) –Set to
trueto use OAuth 2.0 authorization server features in your app client.This parameter must have a value of
truebefore you can configure the following features in your app client.-
CallBackURLs: Callback URLs. -
LogoutURLs: Sign-out redirect URLs. -
AllowedOAuthScopes: OAuth 2.0 scopes. -
AllowedOAuthFlows: Support for authorization code, implicit, and client credentials OAuth 2.0 grants.
To use authorization server features, configure one of these features in the Amazon Cognito console or set
AllowedOAuthFlowsUserPoolClienttotruein aCreateUserPoolClientorUpdateUserPoolClientAPI request. If you don't set a value forAllowedOAuthFlowsUserPoolClientin a request with the CLI or SDKs, it defaults tofalse. Whenfalse, only SDK-based API sign-in is permitted. -
-
analytics_configuration(Optional[AnalyticsConfigurationType], default:None) –The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign.
In Amazon Web Services Regions where Amazon Pinpoint isn't available, user pools might not have access to analytics or might be configurable with campaigns in the US East (N. Virginia) Region. For more information, see Using Amazon Pinpoint analytics.
-
prevent_user_existence_errors(Optional[PreventUserExistenceErrorTypes], default:None) –When
ENABLED, suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set toENABLEDand the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set toLEGACY, those APIs return aUserNotFoundExceptionexception if the user doesn't exist in the user pool.Defaults to
LEGACY. -
enable_token_revocation(Optional[WrappedBooleanType], default:None) –Activates or deactivates token revocation in the target app client.
-
enable_propagate_additional_user_context_data(Optional[WrappedBooleanType], default:None) –When
true, your application can include additionalUserContextDatain authentication requests. This data includes the IP address, and contributes to analysis by threat protection features. For more information about propagation of user context data, see Adding session data to API requests. If you don’t include this parameter, you can't send the source IP address to Amazon Cognito threat protection features. You can only activateEnablePropagateAdditionalUserContextDatain an app client that has a client secret. -
auth_session_validity(Optional[AuthSessionValidityType], default:None) –Amazon Cognito creates a session token for each API request in an authentication flow.
AuthSessionValidityis the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. -
refresh_token_rotation(Optional[RefreshTokenRotationType], default:None) –The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens.
-
publish_secrets_in_aws_secrets_manager(Optional[WrappedBooleanType], default:None) –Specifies whether Amazon Cognito stores and manages this app client's secret in Amazon Web Services Secrets Manager instead of returning the plaintext value. When you set this parameter to
true, the response returnsClientSecretArninstead ofClientSecret. By default, Amazon Cognito rotates the secret every 7 days. You can change the rotation schedule in Secrets Manager.Set to
trueto migrate an existing generated secret into Secrets Manager, orfalseto move it back to Amazon Cognito and delete the Secrets Manager secret. If you omit this parameter, Amazon Cognito doesn't change how it manages the existing secret. Applies only to app clients that already have a generated secret.When you set it to
true, Amazon Cognito starts managing the app client's secret in Secrets Manager and rotates it right away. If the app client has two secrets, that first rotation deletes the older one.When you set this parameter to
false, Amazon Cognito immediately and permanently deletes the Secrets Manager secret. There's no recovery window. Applications that read the secret from Secrets Manager can no longer get it.
Raises:
-
ConcurrentModificationException–This exception is thrown if two or more modifications are happening concurrently.
-
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.
-
-
InternalErrorException–This exception is thrown when Amazon Cognito encounters an internal error.
-
InvalidOAuthFlowException–This exception is thrown when the specified OAuth flow is not valid.
-
InvalidParameterException–This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
-
NotAuthorizedException–This exception is thrown when a user isn't authorized.
-
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.
-
ResourceNotFoundException–This exception is thrown when the Amazon Cognito service can't find the requested resource.
-
ScopeDoesNotExistException–This exception is thrown when the specified scope doesn't exist.
-
TooManyRequestsException–This exception is thrown when the user has made too many requests for a given operation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cognito_identity_provider/_services/async_cognito_identity_provider.py
12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 | |