Skip to content

delete_user_pool_client_secret

delete_user_pool_client_secret(
    user_pool_id: UserPoolIdType,
    client_id: ClientIdType,
    client_secret_id: ClientSecretIdType,
    *,
    config_overrides: Optional[CognitoIdentityProviderClientConfig] = None,
) -> DeleteUserPoolClientSecretResponse

Deletes a specific client secret from a user pool app client. You cannot delete the last remaining secret for an app client.

Parameters:

  • user_pool_id (UserPoolIdType) –

    The ID of the user pool that contains the app client.

  • client_id (ClientIdType) –

    The ID of the app client from which you want to delete the secret.

  • client_secret_id (ClientSecretIdType) –

    The unique identifier of the client secret you want to delete.

Raises:

Source code in docs_src/capo_cognito_identity_provider/_services/cognito_identity_provider.py
def delete_user_pool_client_secret(
    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",
    client_secret_id: "capo_cognito_identity_provider.types.client_secret_id_type.ClientSecretIdType",
    *,
    config_overrides: Optional[CognitoIdentityProviderClientConfig] = None,
) -> "capo_cognito_identity_provider.types.delete_user_pool_client_secret_response.DeleteUserPoolClientSecretResponse":
    """<p>Deletes a specific client secret from a user pool app client. You cannot delete the last remaining secret for an app client.</p>

    Args:
        user_pool_id: <p>The ID of the user pool that contains the app client.</p>
        client_id: <p>The ID of the app client from which you want to delete the secret.</p>
        client_secret_id: <p>The unique identifier of the client secret you want to delete.</p>

    Raises:
        capo_cognito_identity_provider.errors.internal_server_exception.InternalServerException: <p>This exception is thrown when Amazon Cognito encounters an internal server error.</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.limit_exceeded_exception.LimitExceededException: <p>This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_cognito_identity_provider.types.delete_user_pool_client_secret_request.DeleteUserPoolClientSecretRequest]",
    ) -> OperationResponse[
        "capo_cognito_identity_provider.types.delete_user_pool_client_secret_response.DeleteUserPoolClientSecretResponse"
    ]:
        import capo_cognito_identity_provider._operations.aws_cognito_identity_provider_service.delete_user_pool_client_secret

        output, http_response = (
            capo_cognito_identity_provider._operations.aws_cognito_identity_provider_service.delete_user_pool_client_secret.delete_user_pool_client_secret(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_cognito_identity_provider.types.delete_user_pool_client_secret_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DeleteUserPoolClientSecret", redact_input=_redact_input),
    )
    input_: capo_cognito_identity_provider.types.delete_user_pool_client_secret_request.DeleteUserPoolClientSecretRequest = {
        "user_pool_id": user_pool_id,
        "client_id": client_id,
        "client_secret_id": client_secret_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output