Skip to content

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,
) -> 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 RefreshTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

    For example, when you set RefreshTokenValidity as 10 and TokenValidityUnits as days, your user can refresh their session and retrieve new access and ID tokens for 10 days.

    The default time unit for RefreshTokenValidity in an API request is days. You can't set RefreshTokenValidity to 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 AccessTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

    For example, when you set AccessTokenValidity to 10 and TokenValidityUnits to hours, your user can authorize access with their access token for 10 hours.

    The default time unit for AccessTokenValidity in 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 IdTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

    For example, when you set IdTokenValidity as 10 and TokenValidityUnits as hours, your user can authenticate their session with their ID token for 10 hours.

    The default time unit for IdTokenValidity in 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 ReadAttributes for your app client, your app can read the values of email_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, ReadAttributes doesn't return any information. Amazon Cognito only populates ReadAttributes in 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 WriteAttributes for 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, WriteAttributes doesn't return any information. Amazon Cognito only populates WriteAttributes in 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 supports ALLOW_REFRESH_TOKEN_AUTH, ALLOW_USER_SRP_AUTH, and ALLOW_CUSTOM_AUTH.

    The values for authentication flow options include the following.

    • ALLOW_USER_AUTH: Enable selection-based sign-in with USER_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 other ExplicitAuthFlows permitting them. For example users can complete an SRP challenge through USER_AUTH without the flow USER_SRP_AUTH being active for the app client. This flow doesn't include CUSTOM_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 flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH setting. 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.

    In some environments, you will see the values ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, or USER_PASSWORD_AUTH. You can't assign these legacy ExplicitAuthFlows values to user pool clients at the same time as values that begin with ALLOW_, like ALLOW_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, and LoginWithAmazon. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example MySAMLIdP or MyOIDCIdP.

    This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of COGNITO from 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_uri values that aren't in the list of CallbackURLs that 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://example are also supported.

  • logout_ur_ls (Optional[LogoutURLsListType], default: None ) –

    A list of allowed logout URLs for managed login authentication. When you pass logout_uri and client_id parameters 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 of logout_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_uri in authentication requests. Must be in the CallbackURLs list.

  • 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_credentials as 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/token endpoint.

    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/token endpoint 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 userInfo endpoint, and third-party APIs. Scope values include phone, email, openid, and profile. The aws.cognito.signin.user.admin scope 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 true to use OAuth 2.0 authorization server features in your app client.

    This parameter must have a value of true before 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 AllowedOAuthFlowsUserPoolClient to true in a CreateUserPoolClient or UpdateUserPoolClient API request. If you don't set a value for AllowedOAuthFlowsUserPoolClient in a request with the CLI or SDKs, it defaults to false. When false, 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 to ENABLED and 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 to LEGACY, those APIs return a UserNotFoundException exception 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 additional UserContextData in 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 activate EnablePropagateAdditionalUserContextData in 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. AuthSessionValidity is 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.

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
async def update_user_pool_client(
    self,
    user_pool_id: "capo_cognito_identity_provider.types.user_pool_id_type.UserPoolIdType",
    client_id: "capo_cognito_identity_provider.types.client_id_type.ClientIdType",
    *,
    config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
    client_name: Optional[
        "capo_cognito_identity_provider.types.client_name_type.ClientNameType"
    ] = None,
    refresh_token_validity: Optional[
        "capo_cognito_identity_provider.types.refresh_token_validity_type.RefreshTokenValidityType"
    ] = None,
    access_token_validity: Optional[
        "capo_cognito_identity_provider.types.access_token_validity_type.AccessTokenValidityType"
    ] = None,
    id_token_validity: Optional[
        "capo_cognito_identity_provider.types.id_token_validity_type.IdTokenValidityType"
    ] = None,
    token_validity_units: Optional[
        "capo_cognito_identity_provider.types.token_validity_units_type.TokenValidityUnitsType"
    ] = None,
    read_attributes: Optional[
        "capo_cognito_identity_provider.types.client_permission_list_type.ClientPermissionListType"
    ] = None,
    write_attributes: Optional[
        "capo_cognito_identity_provider.types.client_permission_list_type.ClientPermissionListType"
    ] = None,
    explicit_auth_flows: Optional[
        "capo_cognito_identity_provider.types.explicit_auth_flows_list_type.ExplicitAuthFlowsListType"
    ] = None,
    supported_identity_providers: Optional[
        "capo_cognito_identity_provider.types.supported_identity_providers_list_type.SupportedIdentityProvidersListType"
    ] = None,
    callback_ur_ls: Optional[
        "capo_cognito_identity_provider.types.callback_ur_ls_list_type.CallbackURLsListType"
    ] = None,
    logout_ur_ls: Optional[
        "capo_cognito_identity_provider.types.logout_ur_ls_list_type.LogoutURLsListType"
    ] = None,
    default_redirect_uri: Optional[
        "capo_cognito_identity_provider.types.redirect_url_type.RedirectUrlType"
    ] = None,
    allowed_o_auth_flows: Optional[
        "capo_cognito_identity_provider.types.o_auth_flows_type.OAuthFlowsType"
    ] = None,
    allowed_o_auth_scopes: Optional[
        "capo_cognito_identity_provider.types.scope_list_type.ScopeListType"
    ] = None,
    allowed_o_auth_flows_user_pool_client: Optional[
        "capo_cognito_identity_provider.types.boolean_type.BooleanType"
    ] = None,
    analytics_configuration: Optional[
        "capo_cognito_identity_provider.types.analytics_configuration_type.AnalyticsConfigurationType"
    ] = None,
    prevent_user_existence_errors: Optional[
        "capo_cognito_identity_provider.types.prevent_user_existence_error_types.PreventUserExistenceErrorTypes"
    ] = None,
    enable_token_revocation: Optional[
        "capo_cognito_identity_provider.types.wrapped_boolean_type.WrappedBooleanType"
    ] = None,
    enable_propagate_additional_user_context_data: Optional[
        "capo_cognito_identity_provider.types.wrapped_boolean_type.WrappedBooleanType"
    ] = None,
    auth_session_validity: Optional[
        "capo_cognito_identity_provider.types.auth_session_validity_type.AuthSessionValidityType"
    ] = None,
    refresh_token_rotation: Optional[
        "capo_cognito_identity_provider.types.refresh_token_rotation_type.RefreshTokenRotationType"
    ] = None,
) -> "capo_cognito_identity_provider.types.update_user_pool_client_response.UpdateUserPoolClientResponse":
    """<p>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.</p> <important> <p>If you don't provide a value for an attribute, Amazon Cognito sets it to its default value.</p> </important> <p>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.</p> <note> <p>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.</p> <p class="title"> <b>Learn more</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html">Signing Amazon Web Services API Requests</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html">Using the Amazon Cognito user pools API and user pool endpoints</a> </p> </li> </ul> </note>

    Args:
        user_pool_id: <p>The ID of the user pool where you want to update the app client.</p>
        client_id: <p>The ID of the app client that you want to update.</p>
        client_name: <p>A friendly name for the app client.</p>
        refresh_token_validity: <p>The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for <code>RefreshTokenValidity</code> as <code>seconds</code>, <code>minutes</code>, <code>hours</code>, or <code>days</code>, set a <code>TokenValidityUnits</code> value in your API request.</p> <p>For example, when you set <code>RefreshTokenValidity</code> as <code>10</code> and <code>TokenValidityUnits</code> as <code>days</code>, your user can refresh their session and retrieve new access and ID tokens for 10 days.</p> <p>The default time unit for <code>RefreshTokenValidity</code> in an API request is days. You can't set <code>RefreshTokenValidity</code> to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. <i>Valid range</i> is displayed below in seconds.</p> <p>If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days.</p>
        access_token_validity: <p>The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for <code>AccessTokenValidity</code> as <code>seconds</code>, <code>minutes</code>, <code>hours</code>, or <code>days</code>, set a <code>TokenValidityUnits</code> value in your API request.</p> <p>For example, when you set <code>AccessTokenValidity</code> to <code>10</code> and <code>TokenValidityUnits</code> to <code>hours</code>, your user can authorize access with their access token for 10 hours.</p> <p>The default time unit for <code>AccessTokenValidity</code> in an API request is hours. <i>Valid range</i> is displayed below in seconds.</p> <p>If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour.</p>
        id_token_validity: <p>The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for <code>IdTokenValidity</code> as <code>seconds</code>, <code>minutes</code>, <code>hours</code>, or <code>days</code>, set a <code>TokenValidityUnits</code> value in your API request.</p> <p>For example, when you set <code>IdTokenValidity</code> as <code>10</code> and <code>TokenValidityUnits</code> as <code>hours</code>, your user can authenticate their session with their ID token for 10 hours.</p> <p>The default time unit for <code>IdTokenValidity</code> in an API request is hours. <i>Valid range</i> is displayed below in seconds.</p> <p>If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour.</p>
        token_validity_units: <p>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.</p>
        read_attributes: <p>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.</p> <p>When you don't specify the <code>ReadAttributes</code> for your app client, your app can read the values of <code>email_verified</code>, <code>phone_number_verified</code>, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, <code>ReadAttributes</code> doesn't return any information. Amazon Cognito only populates <code>ReadAttributes</code> in the API response if you have specified your own custom set of read attributes.</p>
        write_attributes: <p>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.</p> <p>When you don't specify the <code>WriteAttributes</code> for 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, <code>WriteAttributes</code> doesn't return any information. Amazon Cognito only populates <code>WriteAttributes</code> in the API response if you have specified your own custom set of write attributes.</p> <p>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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-specifying-attribute-mapping.html">Specifying IdP Attribute Mappings for Your user pool</a>.</p>
        explicit_auth_flows: <p>The <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow-methods.html">authentication flows</a> 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.</p> <note> <p>If you don't specify a value for <code>ExplicitAuthFlows</code>, your app client supports <code>ALLOW_REFRESH_TOKEN_AUTH</code>, <code>ALLOW_USER_SRP_AUTH</code>, and <code>ALLOW_CUSTOM_AUTH</code>. </p> </note> <p>The values for authentication flow options include the following.</p> <ul> <li> <p> <code>ALLOW_USER_AUTH</code>: Enable selection-based sign-in with <code>USER_AUTH</code>. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without other <code>ExplicitAuthFlows</code> permitting them. For example users can complete an SRP challenge through <code>USER_AUTH</code> without the flow <code>USER_SRP_AUTH</code> being active for the app client. This flow doesn't include <code>CUSTOM_AUTH</code>. </p> <p>To activate this setting, your user pool must be in the <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/feature-plans-features-essentials.html"> Essentials tier</a> or higher.</p> </li> <li> <p> <code>ALLOW_ADMIN_USER_PASSWORD_AUTH</code>: Enable admin based user password authentication flow <code>ADMIN_USER_PASSWORD_AUTH</code>. This setting replaces the <code>ADMIN_NO_SRP_AUTH</code> setting. 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.</p> </li> <li> <p> <code>ALLOW_CUSTOM_AUTH</code>: Enable Lambda trigger based authentication.</p> </li> <li> <p> <code>ALLOW_USER_PASSWORD_AUTH</code>: 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.</p> </li> <li> <p> <code>ALLOW_USER_SRP_AUTH</code>: Enable SRP-based authentication.</p> </li> <li> <p> <code>ALLOW_REFRESH_TOKEN_AUTH</code>: Enable authflow to refresh tokens.</p> </li> </ul> <p>In some environments, you will see the values <code>ADMIN_NO_SRP_AUTH</code>, <code>CUSTOM_AUTH_FLOW_ONLY</code>, or <code>USER_PASSWORD_AUTH</code>. You can't assign these legacy <code>ExplicitAuthFlows</code> values to user pool clients at the same time as values that begin with <code>ALLOW_</code>, like <code>ALLOW_USER_SRP_AUTH</code>.</p>
        supported_identity_providers: <p>A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: <code>COGNITO</code>, <code>Facebook</code>, <code>Google</code>, <code>SignInWithApple</code>, and <code>LoginWithAmazon</code>. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example <code>MySAMLIdP</code> or <code>MyOIDCIdP</code>.</p> <p>This parameter sets the IdPs that <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-managed-login.html">managed login</a> will display on the login page for your app client. The removal of <code>COGNITO</code> from 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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-waf.html">WAF rule</a>. </p>
        callback_ur_ls: <p>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.</p> <p>A redirect URI must meet the following requirements:</p> <ul> <li> <p>Be an absolute URI.</p> </li> <li> <p>Be registered with the authorization server. Amazon Cognito doesn't accept authorization requests with <code>redirect_uri</code> values that aren't in the list of <code>CallbackURLs</code> that you provide in this parameter.</p> </li> <li> <p>Not include a fragment component.</p> </li> </ul> <p>See <a href="https://tools.ietf.org/html/rfc6749#section-3.1.2">OAuth 2.0 - Redirection Endpoint</a>.</p> <p>Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.</p> <p>App callback URLs such as <code>myapp://example</code> are also supported.</p>
        logout_ur_ls: <p>A list of allowed logout URLs for managed login authentication. When you pass <code>logout_uri</code> and <code>client_id</code> parameters to <code>/logout</code>, 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 of <code>logout_uri</code>. 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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/logout-endpoint.html">Logout endpoint</a>.</p>
        default_redirect_uri: <p>The default redirect URI. In app clients with one assigned IdP, replaces <code>redirect_uri</code> in authentication requests. Must be in the <code>CallbackURLs</code> list.</p>
        allowed_o_auth_flows: <p>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 <code>client_credentials</code> as the only allowed OAuth flow.</p> <dl> <dt>code</dt> <dd> <p>Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the <code>/oauth2/token</code> endpoint.</p> </dd> <dt>implicit</dt> <dd> <p>Issue the access token (and, optionally, ID token, based on scopes) directly to your user.</p> </dd> <dt>client_credentials</dt> <dd> <p>Issue the access token from the <code>/oauth2/token</code> endpoint directly to a non-person user using a combination of the client ID and client secret.</p> </dd> </dl>
        allowed_o_auth_scopes: <p>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 <code>userInfo</code> endpoint, and third-party APIs. Scope values include <code>phone</code>, <code>email</code>, <code>openid</code>, and <code>profile</code>. The <code>aws.cognito.signin.user.admin</code> scope authorizes user self-service operations. Custom scopes with resource servers authorize access to external APIs.</p>
        allowed_o_auth_flows_user_pool_client: <p>Set to <code>true</code> to use OAuth 2.0 authorization server features in your app client.</p> <p>This parameter must have a value of <code>true</code> before you can configure the following features in your app client.</p> <ul> <li> <p> <code>CallBackURLs</code>: Callback URLs.</p> </li> <li> <p> <code>LogoutURLs</code>: Sign-out redirect URLs.</p> </li> <li> <p> <code>AllowedOAuthScopes</code>: OAuth 2.0 scopes.</p> </li> <li> <p> <code>AllowedOAuthFlows</code>: Support for authorization code, implicit, and client credentials OAuth 2.0 grants.</p> </li> </ul> <p>To use authorization server features, configure one of these features in the Amazon Cognito console or set <code>AllowedOAuthFlowsUserPoolClient</code> to <code>true</code> in a <code>CreateUserPoolClient</code> or <code>UpdateUserPoolClient</code> API request. If you don't set a value for <code>AllowedOAuthFlowsUserPoolClient</code> in a request with the CLI or SDKs, it defaults to <code>false</code>. When <code>false</code>, only SDK-based API sign-in is permitted.</p>
        analytics_configuration: <p>The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign.</p> <p>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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-pinpoint-integration.html">Using Amazon Pinpoint analytics</a>.</p>
        prevent_user_existence_errors: <p>When <code>ENABLED</code>, 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 to <code>ENABLED</code> and 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 to <code>LEGACY</code>, those APIs return a <code>UserNotFoundException</code> exception if the user doesn't exist in the user pool.</p> <p>Defaults to <code>LEGACY</code>.</p>
        enable_token_revocation: <p>Activates or deactivates <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/token-revocation.html">token revocation</a> in the target app client.</p>
        enable_propagate_additional_user_context_data: <p>When <code>true</code>, your application can include additional <code>UserContextData</code> in 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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-adaptive-authentication.html#user-pool-settings-adaptive-authentication-device-fingerprint">Adding session data to API requests</a>. If you don’t include this parameter, you can't send the source IP address to Amazon Cognito threat protection features. You can only activate <code>EnablePropagateAdditionalUserContextData</code> in an app client that has a client secret.</p>
        auth_session_validity: <p>Amazon Cognito creates a session token for each API request in an authentication flow. <code>AuthSessionValidity</code> is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires.</p>
        refresh_token_rotation: <p>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.</p>

    Raises:
        capo_cognito_identity_provider.errors.concurrent_modification_exception.ConcurrentModificationException: <p>This exception is thrown if two or more modifications are happening concurrently.</p>
        capo_cognito_identity_provider.errors.feature_unavailable_in_tier_exception.FeatureUnavailableInTierException: <p>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:</p> <ul> <li> <p>You configure a feature that your feature plan doesn't support.</p> </li> <li> <p>You make a request that uses a feature that requires a higher feature plan.</p> </li> </ul> <p>To resolve this issue, upgrade your user pool to a feature plan that includes the feature.</p>
        capo_cognito_identity_provider.errors.internal_error_exception.InternalErrorException: <p>This exception is thrown when Amazon Cognito encounters an internal error.</p>
        capo_cognito_identity_provider.errors.invalid_o_auth_flow_exception.InvalidOAuthFlowException: <p>This exception is thrown when the specified OAuth flow is not valid.</p>
        capo_cognito_identity_provider.errors.invalid_parameter_exception.InvalidParameterException: <p>This exception is thrown when the Amazon Cognito service encounters an invalid parameter.</p>
        capo_cognito_identity_provider.errors.not_authorized_exception.NotAuthorizedException: <p>This exception is thrown when a user isn't authorized.</p>
        capo_cognito_identity_provider.errors.operation_not_enabled_exception.OperationNotEnabledException: <p>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.</p>
        capo_cognito_identity_provider.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when the Amazon Cognito service can't find the requested resource.</p>
        capo_cognito_identity_provider.errors.scope_does_not_exist_exception.ScopeDoesNotExistException: <p>This exception is thrown when the specified scope doesn't exist.</p>
        capo_cognito_identity_provider.errors.too_many_requests_exception.TooManyRequestsException: <p>This exception is thrown when the user has made too many requests for a given operation.</p>
        capo_cognito_identity_provider.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cognito_identity_provider.types.update_user_pool_client_request.UpdateUserPoolClientRequest]",
    ) -> AsyncOperationResponse[
        "capo_cognito_identity_provider.types.update_user_pool_client_response.UpdateUserPoolClientResponse"
    ]:
        import capo_cognito_identity_provider._operations.aws_cognito_identity_provider_service.update_user_pool_client

        (
            output,
            http_response,
        ) = await capo_cognito_identity_provider._operations.aws_cognito_identity_provider_service.update_user_pool_client.async_update_user_pool_client(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cognito_identity_provider.types.update_user_pool_client_request.UpdateUserPoolClientRequest",
    ) -> dict[str, Any]:
        import capo_cognito_identity_provider.types.update_user_pool_client_request

        return capo_cognito_identity_provider.types.update_user_pool_client_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_cognito_identity_provider.types.update_user_pool_client_response.UpdateUserPoolClientResponse",
    ) -> dict[str, Any]:
        import capo_cognito_identity_provider.types.update_user_pool_client_response

        return capo_cognito_identity_provider.types.update_user_pool_client_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateUserPoolClient",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_cognito_identity_provider.types.update_user_pool_client_request.UpdateUserPoolClientRequest = {
        "user_pool_id": user_pool_id,
        "client_id": client_id,
    }
    if client_name is not None:
        input_["client_name"] = client_name
    if refresh_token_validity is not None:
        input_["refresh_token_validity"] = refresh_token_validity
    if access_token_validity is not None:
        input_["access_token_validity"] = access_token_validity
    if id_token_validity is not None:
        input_["id_token_validity"] = id_token_validity
    if token_validity_units is not None:
        input_["token_validity_units"] = token_validity_units
    if read_attributes is not None:
        input_["read_attributes"] = read_attributes
    if write_attributes is not None:
        input_["write_attributes"] = write_attributes
    if explicit_auth_flows is not None:
        input_["explicit_auth_flows"] = explicit_auth_flows
    if supported_identity_providers is not None:
        input_["supported_identity_providers"] = supported_identity_providers
    if callback_ur_ls is not None:
        input_["callback_ur_ls"] = callback_ur_ls
    if logout_ur_ls is not None:
        input_["logout_ur_ls"] = logout_ur_ls
    if default_redirect_uri is not None:
        input_["default_redirect_uri"] = default_redirect_uri
    if allowed_o_auth_flows is not None:
        input_["allowed_o_auth_flows"] = allowed_o_auth_flows
    if allowed_o_auth_scopes is not None:
        input_["allowed_o_auth_scopes"] = allowed_o_auth_scopes
    if allowed_o_auth_flows_user_pool_client is not None:
        input_["allowed_o_auth_flows_user_pool_client"] = (
            allowed_o_auth_flows_user_pool_client
        )
    if analytics_configuration is not None:
        input_["analytics_configuration"] = analytics_configuration
    if prevent_user_existence_errors is not None:
        input_["prevent_user_existence_errors"] = prevent_user_existence_errors
    if enable_token_revocation is not None:
        input_["enable_token_revocation"] = enable_token_revocation
    if enable_propagate_additional_user_context_data is not None:
        input_["enable_propagate_additional_user_context_data"] = (
            enable_propagate_additional_user_context_data
        )
    if auth_session_validity is not None:
        input_["auth_session_validity"] = auth_session_validity
    if refresh_token_rotation is not None:
        input_["refresh_token_rotation"] = refresh_token_rotation

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output