Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

Client for Amazon Cognito Identity Provider

Client for invoking operations on Amazon Cognito Identity Provider. Each operation on Amazon Cognito Identity Provider is a method on this this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.

§Constructing a Client

A Config is required to construct a client. For most use cases, the aws-config crate should be used to automatically resolve this config using aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared across multiple different AWS SDK clients. This config resolution process can be customized by calling aws_config::from_env() instead, which returns a ConfigLoader that uses the builder pattern to customize the default config.

In the simplest case, creating a client looks as follows:

let config = aws_config::load_from_env().await;
let client = aws_sdk_cognitoidentityprovider::Client::new(&config);

Occasionally, SDKs may have additional service-specific values that can be set on the Config that is absent from SdkConfig, or slightly different settings for a specific client may be desired. The Builder struct implements From<&SdkConfig>, so setting these specific settings can be done as follows:

let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_cognitoidentityprovider::config::Builder::from(&sdk_config)
    .some_service_specific_setting("value")
    .build();

See the aws-config docs and Config for more information on customizing configuration.

Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.

§Using the Client

A client has a function for every operation that can be performed by the service. For example, the AddCustomAttributes operation has a Client::add_custom_attributes, function which returns a builder for that operation. The fluent builder ultimately has a send() function that returns an async future that returns a result, as illustrated below:

let result = client.add_custom_attributes()
    .user_pool_id("example")
    .send()
    .await;

The underlying HTTP requests that get made by this can be modified with the customize_operation function on the fluent builder. See the customize module for more information.

Implementations§

Source§

impl Client

Source

pub fn add_custom_attributes(&self) -> AddCustomAttributesFluentBuilder

Constructs a fluent builder for the AddCustomAttributes operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to add custom attributes.


    • custom_attributes(SchemaAttributeType) / set_custom_attributes(Option<Vec::<SchemaAttributeType>>):
      required: true

      An array of custom attribute names and other properties. Sets the following characteristics:

      AttributeDataType

      The expected data type. Can be a string, a number, a date and time, or a boolean.

      Mutable

      If true, you can grant app clients write access to the attribute value. If false, the attribute value can only be set up on sign-up or administrator creation of users.

      Name

      The attribute name. For an attribute like custom:myAttribute, enter myAttribute for this field.

      Required

      When true, users who sign up or are created must set a value for the attribute.

      NumberAttributeConstraints

      The minimum and maximum length of accepted values for a Number-type attribute.

      StringAttributeConstraints

      The minimum and maximum length of accepted values for a String-type attribute.

      DeveloperOnlyAttribute

      This legacy option creates an attribute with a dev: prefix. You can only set the value of a developer-only attribute with administrative IAM credentials.


  • On success, responds with AddCustomAttributesOutput
  • On failure, responds with SdkError<AddCustomAttributesError>
Source§

impl Client

Source

pub fn admin_add_user_to_group(&self) -> AdminAddUserToGroupFluentBuilder

Constructs a fluent builder for the AdminAddUserToGroup operation.

Source§

impl Client

Source

pub fn admin_confirm_sign_up(&self) -> AdminConfirmSignUpFluentBuilder

Constructs a fluent builder for the AdminConfirmSignUp operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to confirm a user’s sign-up request.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      If your user pool configuration includes triggers, the AdminConfirmSignUp API action invokes the Lambda function that is specified for the post confirmation trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. In this payload, the clientMetadata attribute provides the data that you assigned to the ClientMetadata parameter in your AdminConfirmSignUp request. In your function code in Lambda, you can process the ClientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with AdminConfirmSignUpOutput
  • On failure, responds with SdkError<AdminConfirmSignUpError>
Source§

impl Client

Source

pub fn admin_create_user(&self) -> AdminCreateUserFluentBuilder

Constructs a fluent builder for the AdminCreateUser operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to create a user.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The value that you want to set as the username sign-in attribute. The following conditions apply to the username parameter.

      • The username can’t be a duplicate of another username in the same user pool.

      • You can’t change the value of a username after you create it.

      • You can only provide a value if usernames are a valid sign-in attribute for your user pool. If your user pool only supports phone numbers or email addresses as sign-in attributes, Amazon Cognito automatically generates a username value. For more information, see Customizing sign-in attributes.


    • user_attributes(AttributeType) / set_user_attributes(Option<Vec::<AttributeType>>):
      required: false

      An array of name-value pairs that contain user attributes and attribute values to be set for the user to be created. You can create a user without specifying any attributes other than Username. However, any attributes that you specify as required (when creating a user pool or in the Attributes tab of the console) either you should supply (in your call to AdminCreateUser) or the user should supply (when they sign up in response to your welcome message).

      For custom attributes, you must prepend the custom: prefix to the attribute name.

      To send a message inviting the user to sign up, you must specify the user’s email address or phone number. You can do this in your call to AdminCreateUser or in the Users tab of the Amazon Cognito console for managing your user pools.

      You must also provide an email address or phone number when you expect the user to do passwordless sign-in with an email or SMS OTP. These attributes must be provided when passwordless options are the only available, or when you don’t submit a TemporaryPassword.

      In your AdminCreateUser request, you can set the email_verified and phone_number_verified attributes to true. The following conditions apply:

      email

      The email address where you want the user to receive their confirmation code and username. You must provide a value for email when you want to set email_verified to true, or if you set EMAIL in the DesiredDeliveryMediums parameter.

      phone_number

      The phone number where you want the user to receive their confirmation code and username. You must provide a value for phone_number when you want to set phone_number_verified to true, or if you set SMS in the DesiredDeliveryMediums parameter.


    • validation_data(AttributeType) / set_validation_data(Option<Vec::<AttributeType>>):
      required: false

      Temporary user attributes that contribute to the outcomes of your pre sign-up Lambda trigger. This set of key-value pairs are for custom validation of information that you collect from your users but don’t need to retain.

      Your Lambda function can analyze this additional data and act on it. Your function can automatically confirm and verify select users or perform external API operations like logging user attributes and validation data to Amazon CloudWatch Logs.

      For more information about the pre sign-up Lambda trigger, see Pre sign-up Lambda trigger.


    • temporary_password(impl Into<String>) / set_temporary_password(Option<String>):
      required: false

      The user’s temporary password. This password must conform to the password policy that you specified when you created the user pool.

      The exception to the requirement for a password is when your user pool supports passwordless sign-in with email or SMS OTPs. To create a user with no password, omit this parameter or submit a blank value. You can only create a passwordless user when passwordless sign-in is available.

      The temporary password is valid only once. To complete the Admin Create User flow, the user must enter the temporary password in the sign-in page, along with a new password to be used in all future sign-ins.

      If you don’t specify a value, Amazon Cognito generates one for you unless you have passwordless options active for your user pool.

      The temporary password can only be used until the user account expiration limit that you set for your user pool. To reset the account after that time limit, you must call AdminCreateUser again and specify RESEND for the MessageAction parameter.


    • force_alias_creation(bool) / set_force_alias_creation(Option<bool>):
      required: false

      This parameter is used only if the phone_number_verified or email_verified attribute is set to True. Otherwise, it is ignored.

      If this parameter is set to True and the phone number or email address specified in the UserAttributes parameter already exists as an alias with a different user, this request migrates the alias from the previous user to the newly-created user. The previous user will no longer be able to log in using that alias.

      If this parameter is set to False, the API throws an AliasExistsException error if the alias already exists. The default value is False.


    • message_action(MessageActionType) / set_message_action(Option<MessageActionType>):
      required: false

      Set to RESEND to resend the invitation message to a user that already exists, and to reset the temporary-password duration with a new temporary password. Set to SUPPRESS to suppress sending the message. You can specify only one value.


    • desired_delivery_mediums(DeliveryMediumType) / set_desired_delivery_mediums(Option<Vec::<DeliveryMediumType>>):
      required: false

      Specify EMAIL if email will be used to send the welcome message. Specify SMS if the phone number will be used. The default value is SMS. You can specify more than one value.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the AdminCreateUser API action, Amazon Cognito invokes the function that is assigned to the pre sign-up trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. This payload contains a ClientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your AdminCreateUser request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with AdminCreateUserOutput with field(s):
  • On failure, responds with SdkError<AdminCreateUserError>
Source§

impl Client

Source

pub fn admin_delete_user(&self) -> AdminDeleteUserFluentBuilder

Constructs a fluent builder for the AdminDeleteUser operation.

Source§

impl Client

Source

pub fn admin_delete_user_attributes( &self, ) -> AdminDeleteUserAttributesFluentBuilder

Constructs a fluent builder for the AdminDeleteUserAttributes operation.

Source§

impl Client

Source

pub fn admin_disable_provider_for_user( &self, ) -> AdminDisableProviderForUserFluentBuilder

Constructs a fluent builder for the AdminDisableProviderForUser operation.

Source§

impl Client

Source

pub fn admin_disable_user(&self) -> AdminDisableUserFluentBuilder

Constructs a fluent builder for the AdminDisableUser operation.

Source§

impl Client

Source

pub fn admin_enable_user(&self) -> AdminEnableUserFluentBuilder

Constructs a fluent builder for the AdminEnableUser operation.

Source§

impl Client

Source

pub fn admin_forget_device(&self) -> AdminForgetDeviceFluentBuilder

Constructs a fluent builder for the AdminForgetDevice operation.

Source§

impl Client

Source

pub fn admin_get_device(&self) -> AdminGetDeviceFluentBuilder

Constructs a fluent builder for the AdminGetDevice operation.

Source§

impl Client

Source

pub fn admin_get_user(&self) -> AdminGetUserFluentBuilder

Constructs a fluent builder for the AdminGetUser operation.

  • The fluent builder is configurable:
  • On success, responds with AdminGetUserOutput with field(s):
    • username(String):

      The username of the user that you requested.

    • user_attributes(Option<Vec::<AttributeType>>):

      An array of name-value pairs of user attributes and their values, for example “email”: “testuser@example.com”.

    • user_create_date(Option<DateTime>):

      The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

    • user_last_modified_date(Option<DateTime>):

      The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

    • enabled(bool):

      Indicates whether the user is activated for sign-in.

    • user_status(Option<UserStatusType>):

      The user’s status. Can be one of the following:

      • UNCONFIRMED - User has been created but not confirmed.

      • CONFIRMED - User has been confirmed.

      • UNKNOWN - User status isn’t known.

      • RESET_REQUIRED - User is confirmed, but the user must request a code and reset their password before they can sign in.

      • FORCE_CHANGE_PASSWORD - The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change their password to a new value before doing anything else.

      • EXTERNAL_PROVIDER - The user signed in with a third-party identity provider.

    • mfa_options(Option<Vec::<MfaOptionType>>):

      This response parameter is no longer supported. It provides information only about SMS MFA configurations. It doesn’t provide information about time-based one-time password (TOTP) software token MFA configurations. To look up information about either type of MFA configuration, use UserMFASettingList instead.

    • preferred_mfa_setting(Option<String>):

      The user’s preferred MFA. Users can prefer SMS message, email message, or TOTP MFA.

    • user_mfa_setting_list(Option<Vec::<String>>):

      The MFA options that are activated for the user. The possible values in this list are SMS_MFA, EMAIL_OTP, and SOFTWARE_TOKEN_MFA.

  • On failure, responds with SdkError<AdminGetUserError>
Source§

impl Client

Source

pub fn admin_initiate_auth(&self) -> AdminInitiateAuthFluentBuilder

Constructs a fluent builder for the AdminInitiateAuth operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where the user wants to sign in.


    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The ID of the app client where the user wants to sign in.


    • auth_flow(AuthFlowType) / set_auth_flow(Option<AuthFlowType>):
      required: true

      The authentication flow that you want to initiate. Each AuthFlow has linked AuthParameters that you must submit. The following are some example flows.

      USER_AUTH

      The entry point for choice-based authentication with passwords, one-time passwords, and WebAuthn authenticators. Request a preferred authentication type or review available authentication types. From the offered authentication types, select one in a challenge response and then authenticate with that method in an additional challenge response. To activate this setting, your user pool must be in the Essentials tier or higher.

      USER_SRP_AUTH

      Username-password authentication with the Secure Remote Password (SRP) protocol. For more information, see Use SRP password verification in custom authentication flow.

      REFRESH_TOKEN_AUTH and REFRESH_TOKEN

      Receive new ID and access tokens when you pass a REFRESH_TOKEN parameter with a valid refresh token as the value. For more information, see Using the refresh token.

      CUSTOM_AUTH

      Custom authentication with Lambda triggers. For more information, see Custom authentication challenge Lambda triggers.

      ADMIN_USER_PASSWORD_AUTH

      Server-side username-password authentication with the password sent directly in the request. For more information about client-side and server-side authentication, see SDK authorization models.


    • auth_parameters(impl Into<String>, impl Into<String>) / set_auth_parameters(Option<HashMap::<String, String>>):
      required: false

      The authentication parameters. These are inputs corresponding to the AuthFlow that you’re invoking. The required values depend on the value of AuthFlow for example:

      • For USER_AUTH: USERNAME (required), PREFERRED_CHALLENGE. If you don’t provide a value for PREFERRED_CHALLENGE, Amazon Cognito responds with the AvailableChallenges parameter that specifies the available sign-in methods.

      • For USER_SRP_AUTH: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • For ADMIN_USER_PASSWORD_AUTH: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • For REFRESH_TOKEN_AUTH/REFRESH_TOKEN: REFRESH_TOKEN (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • For CUSTOM_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY. To start the authentication flow with password verification, include ChallengeName: SRP_A and SRP_A: (The SRP_A Value).

      For more information about SECRET_HASH, see Computing secret hash values. For information about DEVICE_KEY, see Working with user devices in your user pool.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for certain custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the AdminInitiateAuth API action, Amazon Cognito invokes the Lambda functions that are specified for various triggers. The ClientMetadata value is passed as input to the functions for only the following triggers:

      • Pre signup

      • Pre authentication

      • User migration

      When Amazon Cognito invokes the functions for these triggers, it passes a JSON payload, which the function receives as input. This payload contains a validationData attribute, which provides the data that you assigned to the ClientMetadata parameter in your AdminInitiateAuth request. In your function code in Lambda, you can process the validationData value to enhance your workflow for your specific needs.

      When you use the AdminInitiateAuth API action, Amazon Cognito also invokes the functions for the following triggers, but it doesn’t provide the ClientMetadata value as input:

      • Post authentication

      • Custom message

      • Pre token generation

      • Create auth challenge

      • Define auth challenge

      • Custom email sender

      • Custom SMS sender

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


    • analytics_metadata(AnalyticsMetadataType) / set_analytics_metadata(Option<AnalyticsMetadataType>):
      required: false

      Information that supports analytics outcomes with Amazon Pinpoint, including the user’s endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number.


    • context_data(ContextDataType) / set_context_data(Option<ContextDataType>):
      required: false

      Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

      For more information, see Collecting data for threat protection in applications.


    • session(impl Into<String>) / set_session(Option<String>):
      required: false

      The optional session ID from a ConfirmSignUp API request. You can sign in a user directly from the sign-up process with an AuthFlow of USER_AUTH and AuthParameters of EMAIL_OTP or SMS_OTP, depending on how your user pool sent the confirmation-code message.


  • On success, responds with AdminInitiateAuthOutput with field(s):
    • challenge_name(Option<ChallengeNameType>):

      The name of the challenge that you’re responding to with this call. This is returned in the AdminInitiateAuth response if you must pass another challenge.

      Possible challenges include the following:

      All of the following challenges require USERNAME and, when the app client has a client secret, SECRET_HASH in the parameters.

      • WEB_AUTHN: Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and security keys.

      • PASSWORD: Respond with USER_PASSWORD_AUTH parameters: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • PASSWORD_SRP: Respond with USER_SRP_AUTH parameters: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • SELECT_CHALLENGE: Respond to the challenge with USERNAME and an ANSWER that matches one of the challenge types in the AvailableChallenges response parameter.

      • SMS_MFA: Respond with an SMS_MFA_CODE that your user pool delivered in an SMS message.

      • EMAIL_OTP: Respond with an EMAIL_OTP_CODE that your user pool delivered in an email message.

      • PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations.

      • CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued. The parameters of the challenge are determined by your Lambda function.

      • DEVICE_SRP_AUTH: Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device.

      • DEVICE_PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations. For more information, see Signing in with a device.

      • NEW_PASSWORD_REQUIRED: For users who are required to change their passwords after successful first login. Respond to this challenge with NEW_PASSWORD and any required attributes that Amazon Cognito returned in the requiredAttributes parameter. You can also set values for attributes that aren’t required by your user pool and that your app client can write.

        Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes.

        In a NEW_PASSWORD_REQUIRED challenge response, you can’t modify a required attribute that already has a value. In AdminRespondToAuthChallenge or RespondToAuthChallenge, set a value for any keys that Amazon Cognito returned in the requiredAttributes parameter, then use the AdminUpdateUserAttributes or UpdateUserAttributes API operation to modify the value of any additional attributes.

      • MFA_SETUP: For users who are required to setup an MFA factor before they can sign in. The MFA types activated for the user pool will be listed in the challenge parameters MFAS_CAN_SETUP value.

        To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from InitiateAuth or AdminInitiateAuth as an input to AssociateSoftwareToken. Then, use the session returned by VerifySoftwareToken as an input to RespondToAuthChallenge or AdminRespondToAuthChallenge with challenge name MFA_SETUP to complete sign-in.

        To set up SMS or email MFA, collect a phone_number or email attribute for the user. Then restart the authentication flow with an InitiateAuth or AdminInitiateAuth request.

    • session(Option<String>):

      The session that must be passed to challenge-response requests. If an AdminInitiateAuth or AdminRespondToAuthChallenge API request results in another authentication challenge, Amazon Cognito returns a session ID and the parameters of the next challenge. Pass this session ID in the Session parameter of AdminRespondToAuthChallenge.

    • challenge_parameters(Option<HashMap::<String, String>>):

      The parameters of an authentication challenge. Amazon Cognito returns challenge parameters as a guide to the responses your user or application must provide for the returned ChallengeName. Calculate responses to the challenge parameters and pass them in the ChallengeParameters of AdminRespondToAuthChallenge.

      All challenges require USERNAME and, when the app client has a client secret, SECRET_HASH.

      In SRP challenges, Amazon Cognito returns the username attribute in USER_ID_FOR_SRP instead of any email address, preferred username, or phone number alias that you might have specified in your AdminInitiateAuth request. You must use the username and not an alias in the ChallengeResponses of your challenge response.

    • authentication_result(Option<AuthenticationResultType>):

      The outcome of successful authentication. This is only returned if the user pool has no additional challenges to return. If Amazon Cognito returns another challenge, the response includes ChallengeName, ChallengeParameters, and Session so that your user can answer the challenge.

    • available_challenges(Option<Vec::<ChallengeNameType>>):

      This response parameter lists the available authentication challenges that users can select from in choice-based authentication. For example, they might be able to choose between passkey authentication, a one-time password from an SMS message, and a traditional password.

  • On failure, responds with SdkError<AdminInitiateAuthError>
Source§

impl Client

Constructs a fluent builder for the AdminLinkProviderForUser operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to link a federated identity.


    • destination_user(ProviderUserIdentifierType) / set_destination_user(Option<ProviderUserIdentifierType>):
      required: true

      The existing user in the user pool that you want to assign to the external IdP user account. This user can be a local (Username + Password) Amazon Cognito user pools user or a federated user (for example, a SAML or Facebook user). If the user doesn’t exist, Amazon Cognito generates an exception. Amazon Cognito returns this user when the new user (with the linked IdP attribute) signs in.

      For a native username + password user, the ProviderAttributeValue for the DestinationUser should be the username in the user pool. For a federated user, it should be the provider-specific user_id.

      The ProviderAttributeName of the DestinationUser is ignored.

      The ProviderName should be set to Cognito for users in Cognito user pools.

      All attributes in the DestinationUser profile must be mutable. If you have assigned the user any immutable custom attributes, the operation won’t succeed.


    • source_user(ProviderUserIdentifierType) / set_source_user(Option<ProviderUserIdentifierType>):
      required: true

      An external IdP account for a user who doesn’t exist yet in the user pool. This user must be a federated user (for example, a SAML or Facebook user), not another native user.

      If the SourceUser is using a federated social IdP, such as Facebook, Google, or Login with Amazon, you must set the ProviderAttributeName to Cognito_Subject. For social IdPs, the ProviderName will be Facebook, Google, or LoginWithAmazon, and Amazon Cognito will automatically parse the Facebook, Google, and Login with Amazon tokens for id, sub, and user_id, respectively. The ProviderAttributeValue for the user must be the same value as the id, sub, or user_id value found in the social IdP token.

      For OIDC, the ProviderAttributeName can be any mapped value from a claim in the ID token, or that your app retrieves from the userInfo endpoint. For SAML, the ProviderAttributeName can be any mapped value from a claim in the SAML assertion.

      The following additional considerations apply to SourceUser for OIDC and SAML providers.

      • You must map the claim to a user pool attribute in your IdP configuration, and set the user pool attribute name as the value of ProviderAttributeName in your AdminLinkProviderForUser request. For example, email.

      • When you set ProviderAttributeName to Cognito_Subject, Amazon Cognito will automatically parse the default unique identifier found in the subject from the IdP token.


  • On success, responds with AdminLinkProviderForUserOutput
  • On failure, responds with SdkError<AdminLinkProviderForUserError>
Source§

impl Client

Source

pub fn admin_list_devices(&self) -> AdminListDevicesFluentBuilder

Constructs a fluent builder for the AdminListDevices operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where the device owner is a user.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.


    • limit(i32) / set_limit(Option<i32>):
      required: false

      The maximum number of devices that you want Amazon Cognito to return in the response.


    • pagination_token(impl Into<String>) / set_pagination_token(Option<String>):
      required: false

      This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.


  • On success, responds with AdminListDevicesOutput with field(s):
    • devices(Option<Vec::<DeviceType>>):

      An array of devices and their information. Each entry that’s returned includes device information, last-accessed and created dates, and the device key.

    • pagination_token(Option<String>):

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

  • On failure, responds with SdkError<AdminListDevicesError>
Source§

impl Client

Source

pub fn admin_list_groups_for_user(&self) -> AdminListGroupsForUserFluentBuilder

Constructs a fluent builder for the AdminListGroupsForUser operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.


    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to view a user’s groups.


    • limit(i32) / set_limit(Option<i32>):
      required: false

      The maximum number of groups that you want Amazon Cognito to return in the response.


    • next_token(impl Into<String>) / set_next_token(Option<String>):
      required: false

      This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.


  • On success, responds with AdminListGroupsForUserOutput with field(s):
    • groups(Option<Vec::<GroupType>>):

      An array of groups and information about them.

    • next_token(Option<String>):

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

  • On failure, responds with SdkError<AdminListGroupsForUserError>
Source§

impl Client

Source

pub fn admin_list_user_auth_events( &self, ) -> AdminListUserAuthEventsFluentBuilder

Constructs a fluent builder for the AdminListUserAuthEvents operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The Id of the user pool that contains the user profile with the logged events.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.


    • max_results(i32) / set_max_results(Option<i32>):
      required: false

      The maximum number of authentication events to return. Returns 60 events if you set MaxResults to 0, or if you don’t include a MaxResults parameter.


    • next_token(impl Into<String>) / set_next_token(Option<String>):
      required: false

      This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.


  • On success, responds with AdminListUserAuthEventsOutput with field(s):
    • auth_events(Option<Vec::<AuthEventType>>):

      The response object. It includes the EventID, EventType, CreationDate, EventRisk, and EventResponse.

    • next_token(Option<String>):

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

  • On failure, responds with SdkError<AdminListUserAuthEventsError>
Source§

impl Client

Source

pub fn admin_remove_user_from_group( &self, ) -> AdminRemoveUserFromGroupFluentBuilder

Constructs a fluent builder for the AdminRemoveUserFromGroup operation.

Source§

impl Client

Source

pub fn admin_reset_user_password(&self) -> AdminResetUserPasswordFluentBuilder

Constructs a fluent builder for the AdminResetUserPassword operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to reset the user’s password.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. The AdminResetUserPassword API operation invokes the function that is assigned to the custom message trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your AdminResetUserPassword request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with AdminResetUserPasswordOutput
  • On failure, responds with SdkError<AdminResetUserPasswordError>
Source§

impl Client

Source

pub fn admin_respond_to_auth_challenge( &self, ) -> AdminRespondToAuthChallengeFluentBuilder

Constructs a fluent builder for the AdminRespondToAuthChallenge operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to respond to an authentication challenge.


    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The ID of the app client where you initiated sign-in.


    • challenge_name(ChallengeNameType) / set_challenge_name(Option<ChallengeNameType>):
      required: true

      The name of the challenge that you are responding to.

      Possible challenges include the following:

      All of the following challenges require USERNAME and, when the app client has a client secret, SECRET_HASH in the parameters.

      • WEB_AUTHN: Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and security keys.

      • PASSWORD: Respond with USER_PASSWORD_AUTH parameters: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • PASSWORD_SRP: Respond with USER_SRP_AUTH parameters: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • SELECT_CHALLENGE: Respond to the challenge with USERNAME and an ANSWER that matches one of the challenge types in the AvailableChallenges response parameter.

      • SMS_MFA: Respond with an SMS_MFA_CODE that your user pool delivered in an SMS message.

      • EMAIL_OTP: Respond with an EMAIL_OTP_CODE that your user pool delivered in an email message.

      • PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations.

      • CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued. The parameters of the challenge are determined by your Lambda function.

      • DEVICE_SRP_AUTH: Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device.

      • DEVICE_PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations. For more information, see Signing in with a device.

      • NEW_PASSWORD_REQUIRED: For users who are required to change their passwords after successful first login. Respond to this challenge with NEW_PASSWORD and any required attributes that Amazon Cognito returned in the requiredAttributes parameter. You can also set values for attributes that aren’t required by your user pool and that your app client can write.

        Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes.

        In a NEW_PASSWORD_REQUIRED challenge response, you can’t modify a required attribute that already has a value. In AdminRespondToAuthChallenge or RespondToAuthChallenge, set a value for any keys that Amazon Cognito returned in the requiredAttributes parameter, then use the AdminUpdateUserAttributes or UpdateUserAttributes API operation to modify the value of any additional attributes.

      • MFA_SETUP: For users who are required to setup an MFA factor before they can sign in. The MFA types activated for the user pool will be listed in the challenge parameters MFAS_CAN_SETUP value.

        To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from InitiateAuth or AdminInitiateAuth as an input to AssociateSoftwareToken. Then, use the session returned by VerifySoftwareToken as an input to RespondToAuthChallenge or AdminRespondToAuthChallenge with challenge name MFA_SETUP to complete sign-in.

        To set up SMS or email MFA, collect a phone_number or email attribute for the user. Then restart the authentication flow with an InitiateAuth or AdminInitiateAuth request.


    • challenge_responses(impl Into<String>, impl Into<String>) / set_challenge_responses(Option<HashMap::<String, String>>):
      required: false

      The responses to the challenge that you received in the previous request. Each challenge has its own required response parameters. The following examples are partial JSON request bodies that highlight challenge-response parameters.

      You must provide a SECRET_HASH parameter in all challenge responses to an app client that has a client secret. Include a DEVICE_KEY for device authentication.

      SELECT_CHALLENGE

      “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “USERNAME”: “[username]”, “ANSWER”: “[Challenge name]”}

      Available challenges are PASSWORD, PASSWORD_SRP, EMAIL_OTP, SMS_OTP, and WEB_AUTHN.

      Complete authentication in the SELECT_CHALLENGE response for PASSWORD, PASSWORD_SRP, and WEB_AUTHN:

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “WEB_AUTHN”, “USERNAME”: “[username]”, “CREDENTIAL”: “[AuthenticationResponseJSON]”}

        See AuthenticationResponseJSON.

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “PASSWORD”, “USERNAME”: “[username]”, “PASSWORD”: “[password]”}

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “PASSWORD_SRP”, “USERNAME”: “[username]”, “SRP_A”: “[SRP_A]”}

      For SMS_OTP and EMAIL_OTP, respond with the username and answer. Your user pool will send a code for the user to submit in the next challenge response.

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “SMS_OTP”, “USERNAME”: “[username]”}

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “EMAIL_OTP”, “USERNAME”: “[username]”}

      SMS_OTP

      “ChallengeName”: “SMS_OTP”, “ChallengeResponses”: {“SMS_OTP_CODE”: “[code]”, “USERNAME”: “[username]”}

      EMAIL_OTP

      “ChallengeName”: “EMAIL_OTP”, “ChallengeResponses”: {“EMAIL_OTP_CODE”: “[code]”, “USERNAME”: “[username]”}

      SMS_MFA

      “ChallengeName”: “SMS_MFA”, “ChallengeResponses”: {“SMS_MFA_CODE”: “[code]”, “USERNAME”: “[username]”}

      PASSWORD_VERIFIER

      This challenge response is part of the SRP flow. Amazon Cognito requires that your application respond to this challenge within a few seconds. When the response time exceeds this period, your user pool returns a NotAuthorizedException error.

      “ChallengeName”: “PASSWORD_VERIFIER”, “ChallengeResponses”: {“PASSWORD_CLAIM_SIGNATURE”: “[claim_signature]”, “PASSWORD_CLAIM_SECRET_BLOCK”: “[secret_block]”, “TIMESTAMP”: [timestamp], “USERNAME”: “[username]”}

      Add “DEVICE_KEY” when you sign in with a remembered device.

      CUSTOM_CHALLENGE

      “ChallengeName”: “CUSTOM_CHALLENGE”, “ChallengeResponses”: {“USERNAME”: “[username]”, “ANSWER”: “[challenge_answer]”}

      Add “DEVICE_KEY” when you sign in with a remembered device.

      NEW_PASSWORD_REQUIRED

      “ChallengeName”: “NEW_PASSWORD_REQUIRED”, “ChallengeResponses”: {“NEW_PASSWORD”: “[new_password]”, “USERNAME”: “[username]”}

      To set any required attributes that InitiateAuth returned in an requiredAttributes parameter, add “userAttributes.[attribute_name]”: “[attribute_value]”. This parameter can also set values for writable attributes that aren’t required by your user pool.

      In a NEW_PASSWORD_REQUIRED challenge response, you can’t modify a required attribute that already has a value. In AdminRespondToAuthChallenge or RespondToAuthChallenge, set a value for any keys that Amazon Cognito returned in the requiredAttributes parameter, then use the AdminUpdateUserAttributes or UpdateUserAttributes API operation to modify the value of any additional attributes.

      SOFTWARE_TOKEN_MFA

      “ChallengeName”: “SOFTWARE_TOKEN_MFA”, “ChallengeResponses”: {“USERNAME”: “[username]”, “SOFTWARE_TOKEN_MFA_CODE”: [authenticator_code]}

      DEVICE_SRP_AUTH

      “ChallengeName”: “DEVICE_SRP_AUTH”, “ChallengeResponses”: {“USERNAME”: “[username]”, “DEVICE_KEY”: “[device_key]”, “SRP_A”: “[srp_a]”}

      DEVICE_PASSWORD_VERIFIER

      “ChallengeName”: “DEVICE_PASSWORD_VERIFIER”, “ChallengeResponses”: {“DEVICE_KEY”: “[device_key]”, “PASSWORD_CLAIM_SIGNATURE”: “[claim_signature]”, “PASSWORD_CLAIM_SECRET_BLOCK”: “[secret_block]”, “TIMESTAMP”: [timestamp], “USERNAME”: “[username]”}

      MFA_SETUP

      “ChallengeName”: “MFA_SETUP”, “ChallengeResponses”: {“USERNAME”: “[username]”}, “SESSION”: “[Session ID from VerifySoftwareToken]”

      SELECT_MFA_TYPE

      “ChallengeName”: “SELECT_MFA_TYPE”, “ChallengeResponses”: {“USERNAME”: “[username]”, “ANSWER”: “[SMS_MFA or SOFTWARE_TOKEN_MFA]”}

      For more information about SECRET_HASH, see Computing secret hash values. For information about DEVICE_KEY, see Working with user devices in your user pool.


    • session(impl Into<String>) / set_session(Option<String>):
      required: false

      The session identifier that maintains the state of authentication requests and challenge responses. If an AdminInitiateAuth or AdminRespondToAuthChallenge API request results in a determination that your application must pass another challenge, Amazon Cognito returns a session with other challenge parameters. Send this session identifier, unmodified, to the next AdminRespondToAuthChallenge request.


    • analytics_metadata(AnalyticsMetadataType) / set_analytics_metadata(Option<AnalyticsMetadataType>):
      required: false

      Information that supports analytics outcomes with Amazon Pinpoint, including the user’s endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number.


    • context_data(ContextDataType) / set_context_data(Option<ContextDataType>):
      required: false

      Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

      For more information, see Collecting data for threat protection in applications.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the AdminRespondToAuthChallenge API action, Amazon Cognito invokes any functions that you have assigned to the following triggers:

      • Pre sign-up

      • custom message

      • Post authentication

      • User migration

      • Pre token generation

      • Define auth challenge

      • Create auth challenge

      • Verify auth challenge response

      When Amazon Cognito invokes any of these functions, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute that provides the data that you assigned to the ClientMetadata parameter in your AdminRespondToAuthChallenge request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with AdminRespondToAuthChallengeOutput with field(s):
    • challenge_name(Option<ChallengeNameType>):

      The name of the next challenge that you must respond to.

      Possible challenges include the following:

      All of the following challenges require USERNAME and, when the app client has a client secret, SECRET_HASH in the parameters.

      • WEB_AUTHN: Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and security keys.

      • PASSWORD: Respond with USER_PASSWORD_AUTH parameters: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • PASSWORD_SRP: Respond with USER_SRP_AUTH parameters: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • SELECT_CHALLENGE: Respond to the challenge with USERNAME and an ANSWER that matches one of the challenge types in the AvailableChallenges response parameter.

      • SMS_MFA: Respond with an SMS_MFA_CODE that your user pool delivered in an SMS message.

      • EMAIL_OTP: Respond with an EMAIL_OTP_CODE that your user pool delivered in an email message.

      • PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations.

      • CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued. The parameters of the challenge are determined by your Lambda function.

      • DEVICE_SRP_AUTH: Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device.

      • DEVICE_PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations. For more information, see Signing in with a device.

      • NEW_PASSWORD_REQUIRED: For users who are required to change their passwords after successful first login. Respond to this challenge with NEW_PASSWORD and any required attributes that Amazon Cognito returned in the requiredAttributes parameter. You can also set values for attributes that aren’t required by your user pool and that your app client can write.

        Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes.

        In a NEW_PASSWORD_REQUIRED challenge response, you can’t modify a required attribute that already has a value. In AdminRespondToAuthChallenge or RespondToAuthChallenge, set a value for any keys that Amazon Cognito returned in the requiredAttributes parameter, then use the AdminUpdateUserAttributes or UpdateUserAttributes API operation to modify the value of any additional attributes.

      • MFA_SETUP: For users who are required to setup an MFA factor before they can sign in. The MFA types activated for the user pool will be listed in the challenge parameters MFAS_CAN_SETUP value.

        To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from InitiateAuth or AdminInitiateAuth as an input to AssociateSoftwareToken. Then, use the session returned by VerifySoftwareToken as an input to RespondToAuthChallenge or AdminRespondToAuthChallenge with challenge name MFA_SETUP to complete sign-in.

        To set up SMS or email MFA, collect a phone_number or email attribute for the user. Then restart the authentication flow with an InitiateAuth or AdminInitiateAuth request.

    • session(Option<String>):

      The session identifier that maintains the state of authentication requests and challenge responses. If an AdminInitiateAuth or AdminRespondToAuthChallenge API request results in a determination that your application must pass another challenge, Amazon Cognito returns a session with other challenge parameters. Send this session identifier, unmodified, to the next AdminRespondToAuthChallenge request.

    • challenge_parameters(Option<HashMap::<String, String>>):

      The parameters that define your response to the next challenge.

    • authentication_result(Option<AuthenticationResultType>):

      The outcome of a successful authentication process. After your application has passed all challenges, Amazon Cognito returns an AuthenticationResult with the JSON web tokens (JWTs) that indicate successful sign-in.

  • On failure, responds with SdkError<AdminRespondToAuthChallengeError>
Source§

impl Client

Source

pub fn admin_set_user_mfa_preference( &self, ) -> AdminSetUserMFAPreferenceFluentBuilder

Constructs a fluent builder for the AdminSetUserMFAPreference operation.

Source§

impl Client

Source

pub fn admin_set_user_password(&self) -> AdminSetUserPasswordFluentBuilder

Constructs a fluent builder for the AdminSetUserPassword operation.

Source§

impl Client

Source

pub fn admin_set_user_settings(&self) -> AdminSetUserSettingsFluentBuilder

Constructs a fluent builder for the AdminSetUserSettings operation.

Source§

impl Client

Source

pub fn admin_update_auth_event_feedback( &self, ) -> AdminUpdateAuthEventFeedbackFluentBuilder

Constructs a fluent builder for the AdminUpdateAuthEventFeedback operation.

Source§

impl Client

Source

pub fn admin_update_device_status(&self) -> AdminUpdateDeviceStatusFluentBuilder

Constructs a fluent builder for the AdminUpdateDeviceStatus operation.

Source§

impl Client

Source

pub fn admin_update_user_attributes( &self, ) -> AdminUpdateUserAttributesFluentBuilder

Constructs a fluent builder for the AdminUpdateUserAttributes operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to update user attributes.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.


    • user_attributes(AttributeType) / set_user_attributes(Option<Vec::<AttributeType>>):
      required: true

      An array of name-value pairs representing user attributes.

      For custom attributes, you must prepend the custom: prefix to the attribute name.

      If your user pool requires verification before Amazon Cognito updates an attribute value that you specify in this request, Amazon Cognito doesn’t immediately update the value of that attribute. After your user receives and responds to a verification message to verify the new value, Amazon Cognito updates the attribute value. Your user can sign in and receive messages with the original attribute value until they verify the new value.

      To skip the verification message and update the value of an attribute that requires verification in the same API request, include the email_verified or phone_number_verified attribute, with a value of true. If you set the email_verified or phone_number_verified value for an email or phone_number attribute that requires verification to true, Amazon Cognito doesn’t send a verification message to your user.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the AdminUpdateUserAttributes API action, Amazon Cognito invokes the function that is assigned to the custom message trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your AdminUpdateUserAttributes request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with AdminUpdateUserAttributesOutput
  • On failure, responds with SdkError<AdminUpdateUserAttributesError>
Source§

impl Client

Source

pub fn admin_user_global_sign_out(&self) -> AdminUserGlobalSignOutFluentBuilder

Constructs a fluent builder for the AdminUserGlobalSignOut operation.

Source§

impl Client

Source

pub fn associate_software_token(&self) -> AssociateSoftwareTokenFluentBuilder

Constructs a fluent builder for the AssociateSoftwareToken operation.

Source§

impl Client

Source

pub fn change_password(&self) -> ChangePasswordFluentBuilder

Constructs a fluent builder for the ChangePassword operation.

Source§

impl Client

Source

pub fn complete_web_authn_registration( &self, ) -> CompleteWebAuthnRegistrationFluentBuilder

Constructs a fluent builder for the CompleteWebAuthnRegistration operation.

Source§

impl Client

Source

pub fn confirm_device(&self) -> ConfirmDeviceFluentBuilder

Constructs a fluent builder for the ConfirmDevice operation.

Source§

impl Client

Source

pub fn confirm_forgot_password(&self) -> ConfirmForgotPasswordFluentBuilder

Constructs a fluent builder for the ConfirmForgotPassword operation.

Source§

impl Client

Source

pub fn confirm_sign_up(&self) -> ConfirmSignUpFluentBuilder

Constructs a fluent builder for the ConfirmSignUp operation.

  • The fluent builder is configurable:
    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The ID of the app client associated with the user pool.


    • secret_hash(impl Into<String>) / set_secret_hash(Option<String>):
      required: false

      A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message. For more information about SecretHash, see Computing secret hash values.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.


    • confirmation_code(impl Into<String>) / set_confirmation_code(Option<String>):
      required: true

      The confirmation code that your user pool sent in response to the SignUp request.


    • force_alias_creation(bool) / set_force_alias_creation(Option<bool>):
      required: false

      When true, forces user confirmation despite any existing aliases. Defaults to false. A value of true migrates the alias from an existing user to the new user if an existing user already has the phone number or email address as an alias.

      Say, for example, that an existing user has an email attribute of bob@example.com and email is an alias in your user pool. If the new user also has an email of bob@example.com and your ConfirmSignUp response sets ForceAliasCreation to true, the new user can sign in with a username of bob@example.com and the existing user can no longer do so.

      If false and an attribute belongs to an existing alias, this request returns an AliasExistsException error.

      For more information about sign-in aliases, see Customizing sign-in attributes.


    • analytics_metadata(AnalyticsMetadataType) / set_analytics_metadata(Option<AnalyticsMetadataType>):
      required: false

      Information that supports analytics outcomes with Amazon Pinpoint, including the user’s endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number.


    • user_context_data(UserContextDataType) / set_user_context_data(Option<UserContextDataType>):
      required: false

      Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

      For more information, see Collecting data for threat protection in applications.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the ConfirmSignUp API action, Amazon Cognito invokes the function that is assigned to the post confirmation trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your ConfirmSignUp request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


    • session(impl Into<String>) / set_session(Option<String>):
      required: false

      The optional session ID from a SignUp API request. You can sign in a user directly from the sign-up process with the USER_AUTH authentication flow.


  • On success, responds with ConfirmSignUpOutput with field(s):
    • session(Option<String>):

      A session identifier that you can use to immediately sign in the confirmed user. You can automatically sign users in with the one-time password that they provided in a successful ConfirmSignUp request.

  • On failure, responds with SdkError<ConfirmSignUpError>
Source§

impl Client

Source

pub fn create_group(&self) -> CreateGroupFluentBuilder

Constructs a fluent builder for the CreateGroup operation.

  • The fluent builder is configurable:
    • group_name(impl Into<String>) / set_group_name(Option<String>):
      required: true

      A name for the group. This name must be unique in your user pool.


    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to create a user group.


    • description(impl Into<String>) / set_description(Option<String>):
      required: false

      A description of the group that you’re creating.


    • role_arn(impl Into<String>) / set_role_arn(Option<String>):
      required: false

      The Amazon Resource Name (ARN) for the IAM role that you want to associate with the group. A group role primarily declares a preferred role for the credentials that you get from an identity pool. Amazon Cognito ID tokens have a cognito:preferred_role claim that presents the highest-precedence group that a user belongs to. Both ID and access tokens also contain a cognito:groups claim that list all the groups that a user is a member of.


    • precedence(i32) / set_precedence(Option<i32>):
      required: false

      A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower Precedence values take precedence over groups with higher or null Precedence values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user’s tokens for the cognito:roles and cognito:preferred_role claims.

      Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim isn’t set in users’ tokens.

      The default Precedence value is null. The maximum Precedence value is 2^31-1.


  • On success, responds with CreateGroupOutput with field(s):
  • On failure, responds with SdkError<CreateGroupError>
Source§

impl Client

Source

pub fn create_identity_provider(&self) -> CreateIdentityProviderFluentBuilder

Constructs a fluent builder for the CreateIdentityProvider operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The Id of the user pool where you want to create an IdP.


    • provider_name(impl Into<String>) / set_provider_name(Option<String>):
      required: true

      The name that you want to assign to the IdP. You can pass the identity provider name in the identity_provider query parameter of requests to the Authorize endpoint to silently redirect to sign-in with the associated IdP.


    • provider_type(IdentityProviderTypeType) / set_provider_type(Option<IdentityProviderTypeType>):
      required: true

      The type of IdP that you want to add. Amazon Cognito supports OIDC, SAML 2.0, Login With Amazon, Sign In With Apple, Google, and Facebook IdPs.


    • provider_details(impl Into<String>, impl Into<String>) / set_provider_details(Option<HashMap::<String, String>>):
      required: true

      The scopes, URLs, and identifiers for your external identity provider. The following examples describe the provider detail keys for each IdP type. These values and their schema are subject to change. Social IdP authorize_scopes values must match the values listed here.

      OpenID Connect (OIDC)

      Amazon Cognito accepts the following elements when it can’t discover endpoint URLs from oidc_issuer: attributes_url, authorize_url, jwks_uri, token_url.

      Create or update request: “ProviderDetails”: { “attributes_request_method”: “GET”, “attributes_url”: “https://auth.example.com/userInfo”, “authorize_scopes”: “openid profile email”, “authorize_url”: “https://auth.example.com/authorize”, “client_id”: “1example23456789”, “client_secret”: “provider-app-client-secret”, “jwks_uri”: “https://auth.example.com/.well-known/jwks.json”, “oidc_issuer”: “https://auth.example.com”, “token_url”: “https://example.com/token” }

      Describe response: “ProviderDetails”: { “attributes_request_method”: “GET”, “attributes_url”: “https://auth.example.com/userInfo”, “attributes_url_add_attributes”: “false”, “authorize_scopes”: “openid profile email”, “authorize_url”: “https://auth.example.com/authorize”, “client_id”: “1example23456789”, “client_secret”: “provider-app-client-secret”, “jwks_uri”: “https://auth.example.com/.well-known/jwks.json”, “oidc_issuer”: “https://auth.example.com”, “token_url”: “https://example.com/token” }

      SAML

      Create or update request with Metadata URL: “ProviderDetails”: { “IDPInit”: “true”, “IDPSignout”: “true”, “EncryptedResponses” : “true”, “MetadataURL”: “https://auth.example.com/sso/saml/metadata”, “RequestSigningAlgorithm”: “rsa-sha256” }

      Create or update request with Metadata file: “ProviderDetails”: { “IDPInit”: “true”, “IDPSignout”: “true”, “EncryptedResponses” : “true”, “MetadataFile”: “[metadata XML]”, “RequestSigningAlgorithm”: “rsa-sha256” }

      The value of MetadataFile must be the plaintext metadata document with all quote (“) characters escaped by backslashes.

      Describe response: “ProviderDetails”: { “IDPInit”: “true”, “IDPSignout”: “true”, “EncryptedResponses” : “true”, “ActiveEncryptionCertificate”: “[certificate]”, “MetadataURL”: “https://auth.example.com/sso/saml/metadata”, “RequestSigningAlgorithm”: “rsa-sha256”, “SLORedirectBindingURI”: “https://auth.example.com/slo/saml”, “SSORedirectBindingURI”: “https://auth.example.com/sso/saml” }

      LoginWithAmazon

      Create or update request: “ProviderDetails”: { “authorize_scopes”: “profile postal_code”, “client_id”: “amzn1.application-oa2-client.1example23456789”, “client_secret”: “provider-app-client-secret”

      Describe response: “ProviderDetails”: { “attributes_url”: “https://api.amazon.com/user/profile”, “attributes_url_add_attributes”: “false”, “authorize_scopes”: “profile postal_code”, “authorize_url”: “https://www.amazon.com/ap/oa”, “client_id”: “amzn1.application-oa2-client.1example23456789”, “client_secret”: “provider-app-client-secret”, “token_request_method”: “POST”, “token_url”: “https://api.amazon.com/auth/o2/token” }

      Google

      Create or update request: “ProviderDetails”: { “authorize_scopes”: “email profile openid”, “client_id”: “1example23456789.apps.googleusercontent.com”, “client_secret”: “provider-app-client-secret” }

      Describe response: “ProviderDetails”: { “attributes_url”: “https://people.googleapis.com/v1/people/me?personFields=”, “attributes_url_add_attributes”: “true”, “authorize_scopes”: “email profile openid”, “authorize_url”: “https://accounts.google.com/o/oauth2/v2/auth”, “client_id”: “1example23456789.apps.googleusercontent.com”, “client_secret”: “provider-app-client-secret”, “oidc_issuer”: “https://accounts.google.com”, “token_request_method”: “POST”, “token_url”: “https://www.googleapis.com/oauth2/v4/token” }

      SignInWithApple

      Create or update request: “ProviderDetails”: { “authorize_scopes”: “email name”, “client_id”: “com.example.cognito”, “private_key”: “1EXAMPLE”, “key_id”: “2EXAMPLE”, “team_id”: “3EXAMPLE” }

      Describe response: “ProviderDetails”: { “attributes_url_add_attributes”: “false”, “authorize_scopes”: “email name”, “authorize_url”: “https://appleid.apple.com/auth/authorize”, “client_id”: “com.example.cognito”, “key_id”: “1EXAMPLE”, “oidc_issuer”: “https://appleid.apple.com”, “team_id”: “2EXAMPLE”, “token_request_method”: “POST”, “token_url”: “https://appleid.apple.com/auth/token” }

      Facebook

      Create or update request: “ProviderDetails”: { “api_version”: “v17.0”, “authorize_scopes”: “public_profile, email”, “client_id”: “1example23456789”, “client_secret”: “provider-app-client-secret” }

      Describe response: “ProviderDetails”: { “api_version”: “v17.0”, “attributes_url”: “https://graph.facebook.com/v17.0/me?fields=”, “attributes_url_add_attributes”: “true”, “authorize_scopes”: “public_profile, email”, “authorize_url”: “https://www.facebook.com/v17.0/dialog/oauth”, “client_id”: “1example23456789”, “client_secret”: “provider-app-client-secret”, “token_request_method”: “GET”, “token_url”: “https://graph.facebook.com/v17.0/oauth/access_token” }


    • attribute_mapping(impl Into<String>, impl Into<String>) / set_attribute_mapping(Option<HashMap::<String, String>>):
      required: false

      A mapping of IdP attributes to standard and custom user pool attributes. Specify a user pool attribute as the key of the key-value pair, and the IdP attribute claim name as the value.


    • idp_identifiers(impl Into<String>) / set_idp_identifiers(Option<Vec::<String>>):
      required: false

      An array of IdP identifiers, for example “IdPIdentifiers”: [ “MyIdP”, “MyIdP2” ]. Identifiers are friendly names that you can pass in the idp_identifier query parameter of requests to the Authorize endpoint to silently redirect to sign-in with the associated IdP. Identifiers in a domain format also enable the use of email-address matching with SAML providers.


  • On success, responds with CreateIdentityProviderOutput with field(s):
  • On failure, responds with SdkError<CreateIdentityProviderError>
Source§

impl Client

Source

pub fn create_managed_login_branding( &self, ) -> CreateManagedLoginBrandingFluentBuilder

Constructs a fluent builder for the CreateManagedLoginBranding operation.

Source§

impl Client

Source

pub fn create_resource_server(&self) -> CreateResourceServerFluentBuilder

Constructs a fluent builder for the CreateResourceServer operation.

Source§

impl Client

Source

pub fn create_user_import_job(&self) -> CreateUserImportJobFluentBuilder

Constructs a fluent builder for the CreateUserImportJob operation.

Source§

impl Client

Source

pub fn create_user_pool(&self) -> CreateUserPoolFluentBuilder

Constructs a fluent builder for the CreateUserPool operation.

Source§

impl Client

Source

pub fn create_user_pool_client(&self) -> CreateUserPoolClientFluentBuilder

Constructs a fluent builder for the CreateUserPoolClient operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to create an app client.


    • client_name(impl Into<String>) / set_client_name(Option<String>):
      required: true

      A friendly name for the app client that you want to create.


    • generate_secret(bool) / set_generate_secret(Option<bool>):
      required: false

      When true, generates a client secret for the app client. Client secrets are used with server-side and machine-to-machine applications. Client secrets are automatically generated; you can’t specify a secret value. For more information, see App client types.


    • refresh_token_validity(i32) / set_refresh_token_validity(Option<i32>):
      required: false

      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(i32) / set_access_token_validity(Option<i32>):
      required: false

      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(i32) / set_id_token_validity(Option<i32>):
      required: false

      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(TokenValidityUnitsType) / set_token_validity_units(Option<TokenValidityUnitsType>):
      required: false

      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(impl Into<String>) / set_read_attributes(Option<Vec::<String>>):
      required: false

      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(impl Into<String>) / set_write_attributes(Option<Vec::<String>>):
      required: false

      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(ExplicitAuthFlowsType) / set_explicit_auth_flows(Option<Vec::<ExplicitAuthFlowsType>>):
      required: false

      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(impl Into<String>) / set_supported_identity_providers(Option<Vec::<String>>):
      required: false

      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_urls(impl Into<String>) / set_callback_urls(Option<Vec::<String>>):
      required: false

      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_urls(impl Into<String>) / set_logout_urls(Option<Vec::<String>>):
      required: false

      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(impl Into<String>) / set_default_redirect_uri(Option<String>):
      required: false

      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(OAuthFlowType) / set_allowed_o_auth_flows(Option<Vec::<OAuthFlowType>>):
      required: false

      The OAuth grant types that you want your app client to generate for clients in managed login authentication. 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 the ID token when scopes like openid and profile are requested, directly to your user.

      client_credentials

      Issue the access token from the /oauth2/token endpoint directly to a non-person user, authorized by a combination of the client ID and client secret.


    • allowed_o_auth_scopes(impl Into<String>) / set_allowed_o_auth_scopes(Option<Vec::<String>>):
      required: false

      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(bool) / set_allowed_o_auth_flows_user_pool_client(Option<bool>):
      required: false

      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(AnalyticsConfigurationType) / set_analytics_configuration(Option<AnalyticsConfigurationType>):
      required: false

      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(PreventUserExistenceErrorTypes) / set_prevent_user_existence_errors(Option<PreventUserExistenceErrorTypes>):
      required: false

      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(bool) / set_enable_token_revocation(Option<bool>):
      required: false

      Activates or deactivates token revocation in the target app client.

      If you don’t include this parameter, token revocation is automatically activated for the new user pool client.


    • enable_propagate_additional_user_context_data(bool) / set_enable_propagate_additional_user_context_data(Option<bool>):
      required: false

      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(i32) / set_auth_session_validity(Option<i32>):
      required: false

      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(RefreshTokenRotationType) / set_refresh_token_rotation(Option<RefreshTokenRotationType>):
      required: false

      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.


  • On success, responds with CreateUserPoolClientOutput with field(s):
  • On failure, responds with SdkError<CreateUserPoolClientError>
Source§

impl Client

Source

pub fn create_user_pool_domain(&self) -> CreateUserPoolDomainFluentBuilder

Constructs a fluent builder for the CreateUserPoolDomain operation.

  • The fluent builder is configurable:
  • On success, responds with CreateUserPoolDomainOutput with field(s):
    • managed_login_version(Option<i32>):

      The version of managed login branding applied your domain. A value of 1 indicates hosted UI (classic) and a version of 2 indicates managed login.

    • cloud_front_domain(Option<String>):

      The fully-qualified domain name (FQDN) of the Amazon CloudFront distribution that hosts your managed login or classic hosted UI pages. Your domain-name authority must have an alias record that points requests for your custom domain to this FQDN. Amazon Cognito returns this value if you set a custom domain with CustomDomainConfig. If you set an Amazon Cognito prefix domain, this parameter returns null.

  • On failure, responds with SdkError<CreateUserPoolDomainError>
Source§

impl Client

Source

pub fn delete_group(&self) -> DeleteGroupFluentBuilder

Constructs a fluent builder for the DeleteGroup operation.

Source§

impl Client

Source

pub fn delete_identity_provider(&self) -> DeleteIdentityProviderFluentBuilder

Constructs a fluent builder for the DeleteIdentityProvider operation.

Source§

impl Client

Source

pub fn delete_managed_login_branding( &self, ) -> DeleteManagedLoginBrandingFluentBuilder

Constructs a fluent builder for the DeleteManagedLoginBranding operation.

Source§

impl Client

Source

pub fn delete_resource_server(&self) -> DeleteResourceServerFluentBuilder

Constructs a fluent builder for the DeleteResourceServer operation.

Source§

impl Client

Source

pub fn delete_user(&self) -> DeleteUserFluentBuilder

Constructs a fluent builder for the DeleteUser operation.

Source§

impl Client

Source

pub fn delete_user_attributes(&self) -> DeleteUserAttributesFluentBuilder

Constructs a fluent builder for the DeleteUserAttributes operation.

Source§

impl Client

Source

pub fn delete_user_pool(&self) -> DeleteUserPoolFluentBuilder

Constructs a fluent builder for the DeleteUserPool operation.

Source§

impl Client

Source

pub fn delete_user_pool_client(&self) -> DeleteUserPoolClientFluentBuilder

Constructs a fluent builder for the DeleteUserPoolClient operation.

Source§

impl Client

Source

pub fn delete_user_pool_domain(&self) -> DeleteUserPoolDomainFluentBuilder

Constructs a fluent builder for the DeleteUserPoolDomain operation.

Source§

impl Client

Source

pub fn delete_web_authn_credential( &self, ) -> DeleteWebAuthnCredentialFluentBuilder

Constructs a fluent builder for the DeleteWebAuthnCredential operation.

Source§

impl Client

Source

pub fn describe_identity_provider( &self, ) -> DescribeIdentityProviderFluentBuilder

Constructs a fluent builder for the DescribeIdentityProvider operation.

Source§

impl Client

Source

pub fn describe_managed_login_branding( &self, ) -> DescribeManagedLoginBrandingFluentBuilder

Constructs a fluent builder for the DescribeManagedLoginBranding operation.

Source§

impl Client

Source

pub fn describe_managed_login_branding_by_client( &self, ) -> DescribeManagedLoginBrandingByClientFluentBuilder

Constructs a fluent builder for the DescribeManagedLoginBrandingByClient operation.

Source§

impl Client

Source

pub fn describe_resource_server(&self) -> DescribeResourceServerFluentBuilder

Constructs a fluent builder for the DescribeResourceServer operation.

Source§

impl Client

Source

pub fn describe_risk_configuration( &self, ) -> DescribeRiskConfigurationFluentBuilder

Constructs a fluent builder for the DescribeRiskConfiguration operation.

Source§

impl Client

Source

pub fn describe_user_import_job(&self) -> DescribeUserImportJobFluentBuilder

Constructs a fluent builder for the DescribeUserImportJob operation.

Source§

impl Client

Source

pub fn describe_user_pool(&self) -> DescribeUserPoolFluentBuilder

Constructs a fluent builder for the DescribeUserPool operation.

Source§

impl Client

Source

pub fn describe_user_pool_client(&self) -> DescribeUserPoolClientFluentBuilder

Constructs a fluent builder for the DescribeUserPoolClient operation.

Source§

impl Client

Source

pub fn describe_user_pool_domain(&self) -> DescribeUserPoolDomainFluentBuilder

Constructs a fluent builder for the DescribeUserPoolDomain operation.

Source§

impl Client

Source

pub fn forget_device(&self) -> ForgetDeviceFluentBuilder

Constructs a fluent builder for the ForgetDevice operation.

Source§

impl Client

Source

pub fn forgot_password(&self) -> ForgotPasswordFluentBuilder

Constructs a fluent builder for the ForgotPassword operation.

  • The fluent builder is configurable:
    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The ID of the user pool app client associated with the current signed-in user.


    • secret_hash(impl Into<String>) / set_secret_hash(Option<String>):
      required: false

      A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message. For more information about SecretHash, see Computing secret hash values.


    • user_context_data(UserContextDataType) / set_user_context_data(Option<UserContextDataType>):
      required: false

      Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

      For more information, see Collecting data for threat protection in applications.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.


    • analytics_metadata(AnalyticsMetadataType) / set_analytics_metadata(Option<AnalyticsMetadataType>):
      required: false

      Information that supports analytics outcomes with Amazon Pinpoint, including the user’s endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the ForgotPassword API action, Amazon Cognito invokes any functions that are assigned to the following triggers: pre sign-up, custom message, and user migration. When Amazon Cognito invokes any of these functions, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your ForgotPassword request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with ForgotPasswordOutput with field(s):
  • On failure, responds with SdkError<ForgotPasswordError>
Source§

impl Client

Source

pub fn get_csv_header(&self) -> GetCSVHeaderFluentBuilder

Constructs a fluent builder for the GetCSVHeader operation.

Source§

impl Client

Source

pub fn get_device(&self) -> GetDeviceFluentBuilder

Constructs a fluent builder for the GetDevice operation.

Source§

impl Client

Source

pub fn get_group(&self) -> GetGroupFluentBuilder

Constructs a fluent builder for the GetGroup operation.

Source§

impl Client

Source

pub fn get_identity_provider_by_identifier( &self, ) -> GetIdentityProviderByIdentifierFluentBuilder

Constructs a fluent builder for the GetIdentityProviderByIdentifier operation.

Source§

impl Client

Source

pub fn get_log_delivery_configuration( &self, ) -> GetLogDeliveryConfigurationFluentBuilder

Constructs a fluent builder for the GetLogDeliveryConfiguration operation.

Source§

impl Client

Source

pub fn get_signing_certificate(&self) -> GetSigningCertificateFluentBuilder

Constructs a fluent builder for the GetSigningCertificate operation.

Source§

impl Client

Source

pub fn get_tokens_from_refresh_token( &self, ) -> GetTokensFromRefreshTokenFluentBuilder

Constructs a fluent builder for the GetTokensFromRefreshToken operation.

  • The fluent builder is configurable:
    • refresh_token(impl Into<String>) / set_refresh_token(Option<String>):
      required: true

      A valid refresh token that can authorize the request for new tokens. When refresh token rotation is active in the requested app client, this token is invalidated after the request is complete.


    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The app client that issued the refresh token to the user who wants to request new tokens.


    • client_secret(impl Into<String>) / set_client_secret(Option<String>):
      required: false

      The client secret of the requested app client, if the client has a secret.


    • device_key(impl Into<String>) / set_device_key(Option<String>):
      required: false

      When you enable device remembering, Amazon Cognito issues a device key that you can use for device authentication that bypasses multi-factor authentication (MFA). To implement GetTokensFromRefreshToken in a user pool with device remembering, you must capture the device key from the initial authentication request. If your application doesn’t provide the key of a registered device, Amazon Cognito issues a new one. You must provide the confirmed device key in this request if device remembering is enabled in your user pool.

      For more information about device remembering, see Working with devices.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for certain custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the GetTokensFromRefreshToken API action, Amazon Cognito invokes the Lambda function the pre token generation trigger.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with GetTokensFromRefreshTokenOutput with field(s):
  • On failure, responds with SdkError<GetTokensFromRefreshTokenError>
Source§

impl Client

Source

pub fn get_ui_customization(&self) -> GetUICustomizationFluentBuilder

Constructs a fluent builder for the GetUICustomization operation.

Source§

impl Client

Source

pub fn get_user(&self) -> GetUserFluentBuilder

Constructs a fluent builder for the GetUser operation.

Source§

impl Client

Source

pub fn get_user_attribute_verification_code( &self, ) -> GetUserAttributeVerificationCodeFluentBuilder

Constructs a fluent builder for the GetUserAttributeVerificationCode operation.

  • The fluent builder is configurable:
    • access_token(impl Into<String>) / set_access_token(Option<String>):
      required: true

      A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for aws.cognito.signin.user.admin.


    • attribute_name(impl Into<String>) / set_attribute_name(Option<String>):
      required: true

      The name of the attribute that the user wants to verify, for example email.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the GetUserAttributeVerificationCode API action, Amazon Cognito invokes the function that is assigned to the custom message trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your GetUserAttributeVerificationCode request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with GetUserAttributeVerificationCodeOutput with field(s):
  • On failure, responds with SdkError<GetUserAttributeVerificationCodeError>
Source§

impl Client

Source

pub fn get_user_auth_factors(&self) -> GetUserAuthFactorsFluentBuilder

Constructs a fluent builder for the GetUserAuthFactors operation.

Source§

impl Client

Source

pub fn get_user_pool_mfa_config(&self) -> GetUserPoolMfaConfigFluentBuilder

Constructs a fluent builder for the GetUserPoolMfaConfig operation.

Source§

impl Client

Source

pub fn global_sign_out(&self) -> GlobalSignOutFluentBuilder

Constructs a fluent builder for the GlobalSignOut operation.

Source§

impl Client

Source

pub fn initiate_auth(&self) -> InitiateAuthFluentBuilder

Constructs a fluent builder for the InitiateAuth operation.

  • The fluent builder is configurable:
    • auth_flow(AuthFlowType) / set_auth_flow(Option<AuthFlowType>):
      required: true

      The authentication flow that you want to initiate. Each AuthFlow has linked AuthParameters that you must submit. The following are some example flows.

      USER_AUTH

      The entry point for choice-based authentication with passwords, one-time passwords, and WebAuthn authenticators. Request a preferred authentication type or review available authentication types. From the offered authentication types, select one in a challenge response and then authenticate with that method in an additional challenge response. To activate this setting, your user pool must be in the Essentials tier or higher.

      USER_SRP_AUTH

      Username-password authentication with the Secure Remote Password (SRP) protocol. For more information, see Use SRP password verification in custom authentication flow.

      REFRESH_TOKEN_AUTH and REFRESH_TOKEN

      Receive new ID and access tokens when you pass a REFRESH_TOKEN parameter with a valid refresh token as the value. For more information, see Using the refresh token.

      CUSTOM_AUTH

      Custom authentication with Lambda triggers. For more information, see Custom authentication challenge Lambda triggers.

      USER_PASSWORD_AUTH

      Client-side username-password authentication with the password sent directly in the request. For more information about client-side and server-side authentication, see SDK authorization models.

      ADMIN_USER_PASSWORD_AUTH is a flow type of AdminInitiateAuth and isn’t valid for InitiateAuth. ADMIN_NO_SRP_AUTH is a legacy server-side username-password flow and isn’t valid for InitiateAuth.


    • auth_parameters(impl Into<String>, impl Into<String>) / set_auth_parameters(Option<HashMap::<String, String>>):
      required: false

      The authentication parameters. These are inputs corresponding to the AuthFlow that you’re invoking.

      The required values are specific to the InitiateAuthRequest$AuthFlow.

      The following are some authentication flows and their parameters. Add a SECRET_HASH parameter if your app client has a client secret.

      • USER_AUTH: USERNAME (required), PREFERRED_CHALLENGE. If you don’t provide a value for PREFERRED_CHALLENGE, Amazon Cognito responds with the AvailableChallenges parameter that specifies the available sign-in methods.

      • USER_SRP_AUTH: USERNAME (required), SRP_A (required), DEVICE_KEY.

      • USER_PASSWORD_AUTH: USERNAME (required), PASSWORD (required), DEVICE_KEY.

      • REFRESH_TOKEN_AUTH/REFRESH_TOKEN: REFRESH_TOKEN (required), DEVICE_KEY.

      • CUSTOM_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY. To start the authentication flow with password verification, include ChallengeName: SRP_A and SRP_A: (The SRP_A Value).

      For more information about SECRET_HASH, see Computing secret hash values. For information about DEVICE_KEY, see Working with user devices in your user pool.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for certain custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you send an InitiateAuth request, Amazon Cognito invokes the Lambda functions that are specified for various triggers. The ClientMetadata value is passed as input to the functions for only the following triggers.

      • Pre sign-up

      • Pre authentication

      • User migration

      When Amazon Cognito invokes the functions for these triggers, it passes a JSON payload as input to the function. This payload contains a validationData attribute with the data that you assigned to the ClientMetadata parameter in your InitiateAuth request. In your function, validationData can contribute to operations that require data that isn’t in the default payload.

      InitiateAuth requests invokes the following triggers without ClientMetadata as input.

      • Post authentication

      • Custom message

      • Pre token generation

      • Create auth challenge

      • Define auth challenge

      • Custom email sender

      • Custom SMS sender

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The ID of the app client that your user wants to sign in to.


    • analytics_metadata(AnalyticsMetadataType) / set_analytics_metadata(Option<AnalyticsMetadataType>):
      required: false

      Information that supports analytics outcomes with Amazon Pinpoint, including the user’s endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number.


    • user_context_data(UserContextDataType) / set_user_context_data(Option<UserContextDataType>):
      required: false

      Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

      For more information, see Collecting data for threat protection in applications.


    • session(impl Into<String>) / set_session(Option<String>):
      required: false

      The optional session ID from a ConfirmSignUp API request. You can sign in a user directly from the sign-up process with the USER_AUTH authentication flow. When you pass the session ID to InitiateAuth, Amazon Cognito assumes the SMS or email message one-time verification password from ConfirmSignUp as the primary authentication factor. You’re not required to submit this code a second time. This option is only valid for users who have confirmed their sign-up and are signing in for the first time within the authentication flow session duration of the session ID.


  • On success, responds with InitiateAuthOutput with field(s):
    • challenge_name(Option<ChallengeNameType>):

      The name of an additional authentication challenge that you must respond to.

      Possible challenges include the following:

      All of the following challenges require USERNAME and, when the app client has a client secret, SECRET_HASH in the parameters.

      • WEB_AUTHN: Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and security keys.

      • PASSWORD: Respond with USER_PASSWORD_AUTH parameters: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • PASSWORD_SRP: Respond with USER_SRP_AUTH parameters: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • SELECT_CHALLENGE: Respond to the challenge with USERNAME and an ANSWER that matches one of the challenge types in the AvailableChallenges response parameter.

      • SMS_MFA: Respond with an SMS_MFA_CODE that your user pool delivered in an SMS message.

      • EMAIL_OTP: Respond with an EMAIL_OTP_CODE that your user pool delivered in an email message.

      • PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations.

      • CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued. The parameters of the challenge are determined by your Lambda function.

      • DEVICE_SRP_AUTH: Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device.

      • DEVICE_PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations. For more information, see Signing in with a device.

      • NEW_PASSWORD_REQUIRED: For users who are required to change their passwords after successful first login. Respond to this challenge with NEW_PASSWORD and any required attributes that Amazon Cognito returned in the requiredAttributes parameter. You can also set values for attributes that aren’t required by your user pool and that your app client can write.

        Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes.

        In a NEW_PASSWORD_REQUIRED challenge response, you can’t modify a required attribute that already has a value. In AdminRespondToAuthChallenge or RespondToAuthChallenge, set a value for any keys that Amazon Cognito returned in the requiredAttributes parameter, then use the AdminUpdateUserAttributes or UpdateUserAttributes API operation to modify the value of any additional attributes.

      • MFA_SETUP: For users who are required to setup an MFA factor before they can sign in. The MFA types activated for the user pool will be listed in the challenge parameters MFAS_CAN_SETUP value.

        To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from InitiateAuth or AdminInitiateAuth as an input to AssociateSoftwareToken. Then, use the session returned by VerifySoftwareToken as an input to RespondToAuthChallenge or AdminRespondToAuthChallenge with challenge name MFA_SETUP to complete sign-in.

        To set up SMS or email MFA, collect a phone_number or email attribute for the user. Then restart the authentication flow with an InitiateAuth or AdminInitiateAuth request.

    • session(Option<String>):

      The session identifier that links a challenge response to the initial authentication request. If the user must pass another challenge, Amazon Cognito returns a session ID and challenge parameters.

    • challenge_parameters(Option<HashMap::<String, String>>):

      The required parameters of the ChallengeName challenge.

      All challenges require USERNAME. They also require SECRET_HASH if your app client has a client secret.

    • authentication_result(Option<AuthenticationResultType>):

      The result of a successful and complete authentication request. This result is only returned if the user doesn’t need to pass another challenge. If they must pass another challenge before they get tokens, Amazon Cognito returns a challenge in ChallengeName, ChallengeParameters, and Session response parameters.

    • available_challenges(Option<Vec::<ChallengeNameType>>):

      This response parameter lists the available authentication challenges that users can select from in choice-based authentication. For example, they might be able to choose between passkey authentication, a one-time password from an SMS message, and a traditional password.

  • On failure, responds with SdkError<InitiateAuthError>
Source§

impl Client

Source

pub fn list_devices(&self) -> ListDevicesFluentBuilder

Constructs a fluent builder for the ListDevices operation.

  • The fluent builder is configurable:
    • access_token(impl Into<String>) / set_access_token(Option<String>):
      required: true

      A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for aws.cognito.signin.user.admin.


    • limit(i32) / set_limit(Option<i32>):
      required: false

      The maximum number of devices that you want Amazon Cognito to return in the response.


    • pagination_token(impl Into<String>) / set_pagination_token(Option<String>):
      required: false

      This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.


  • On success, responds with ListDevicesOutput with field(s):
    • devices(Option<Vec::<DeviceType>>):

      An array of devices and their details. Each entry that’s returned includes device information, last-accessed and created dates, and the device key.

    • pagination_token(Option<String>):

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

  • On failure, responds with SdkError<ListDevicesError>
Source§

impl Client

Source

pub fn list_groups(&self) -> ListGroupsFluentBuilder

Constructs a fluent builder for the ListGroups operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
  • On success, responds with ListGroupsOutput with field(s):
    • groups(Option<Vec::<GroupType>>):

      An array of groups and their details. Each entry that’s returned includes description, precedence, and IAM role values.

    • next_token(Option<String>):

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

  • On failure, responds with SdkError<ListGroupsError>
Source§

impl Client

Source

pub fn list_identity_providers(&self) -> ListIdentityProvidersFluentBuilder

Constructs a fluent builder for the ListIdentityProviders operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn list_resource_servers(&self) -> ListResourceServersFluentBuilder

Constructs a fluent builder for the ListResourceServers operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn list_tags_for_resource(&self) -> ListTagsForResourceFluentBuilder

Constructs a fluent builder for the ListTagsForResource operation.

Source§

impl Client

Source

pub fn list_user_import_jobs(&self) -> ListUserImportJobsFluentBuilder

Constructs a fluent builder for the ListUserImportJobs operation.

Source§

impl Client

Source

pub fn list_user_pool_clients(&self) -> ListUserPoolClientsFluentBuilder

Constructs a fluent builder for the ListUserPoolClients operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn list_user_pools(&self) -> ListUserPoolsFluentBuilder

Constructs a fluent builder for the ListUserPools operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
    • next_token(impl Into<String>) / set_next_token(Option<String>):
      required: false

      This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.


    • max_results(i32) / set_max_results(Option<i32>):
      required: true

      The maximum number of user pools that you want Amazon Cognito to return in the response.


  • On success, responds with ListUserPoolsOutput with field(s):
    • user_pools(Option<Vec::<UserPoolDescriptionType>>):

      An array of user pools and their configuration details.

    • next_token(Option<String>):

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

  • On failure, responds with SdkError<ListUserPoolsError>
Source§

impl Client

Source

pub fn list_users(&self) -> ListUsersFluentBuilder

Constructs a fluent builder for the ListUsers operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to display or search for users.


    • attributes_to_get(impl Into<String>) / set_attributes_to_get(Option<Vec::<String>>):
      required: false

      A JSON array of user attribute names, for example given_name, that you want Amazon Cognito to include in the response for each user. When you don’t provide an AttributesToGet parameter, Amazon Cognito returns all attributes for each user.

      Use AttributesToGet with required attributes in your user pool, or in conjunction with Filter. Amazon Cognito returns an error if not all users in the results have set a value for the attribute you request. Attributes that you can’t filter on, including custom attributes, must have a value set in every user profile before an AttributesToGet parameter returns results.


    • limit(i32) / set_limit(Option<i32>):
      required: false

      The maximum number of users that you want Amazon Cognito to return in the response.


    • pagination_token(impl Into<String>) / set_pagination_token(Option<String>):
      required: false

      This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.


    • filter(impl Into<String>) / set_filter(Option<String>):
      required: false

      A filter string of the form “AttributeName Filter-Type “AttributeValue”. Quotation marks within the filter string must be escaped using the backslash (</code>) character. For example, “family_name = "Reddy"”.

      • AttributeName: The name of the attribute to search for. You can only search for one attribute at a time.

      • Filter-Type: For an exact match, use =, for example, “given_name = "Jon"”. For a prefix (“starts with”) match, use ^=, for example, “given_name ^= "Jon"”.

      • AttributeValue: The attribute value that must be matched for each user.

      If the filter string is empty, ListUsers returns all users in the user pool.

      You can only search for the following standard attributes:

      • username (case-sensitive)

      • email

      • phone_number

      • name

      • given_name

      • family_name

      • preferred_username

      • cognito:user_status (called Status in the Console) (case-insensitive)

      • status (called Enabled in the Console) (case-sensitive)

      • sub

      Custom attributes aren’t searchable.

      You can also list users with a client-side filter. The server-side filter matches no more than one attribute. For an advanced search, use a client-side filter with the –query parameter of the list-users action in the CLI. When you use a client-side filter, ListUsers returns a paginated list of zero or more users. You can receive multiple pages in a row with zero results. Repeat the query with each pagination token that is returned until you receive a null pagination token value, and then review the combined result.

      For more information about server-side and client-side filtering, see FilteringCLI output in the Command Line Interface User Guide.

      For more information, see Searching for Users Using the ListUsers API and Examples of Using the ListUsers API in the Amazon Cognito Developer Guide.


  • On success, responds with ListUsersOutput with field(s):
    • users(Option<Vec::<UserType>>):

      An array of user pool users who match your query, and their attributes.

    • pagination_token(Option<String>):

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

  • On failure, responds with SdkError<ListUsersError>
Source§

impl Client

Source

pub fn list_users_in_group(&self) -> ListUsersInGroupFluentBuilder

Constructs a fluent builder for the ListUsersInGroup operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn list_web_authn_credentials(&self) -> ListWebAuthnCredentialsFluentBuilder

Constructs a fluent builder for the ListWebAuthnCredentials operation.

Source§

impl Client

Source

pub fn resend_confirmation_code(&self) -> ResendConfirmationCodeFluentBuilder

Constructs a fluent builder for the ResendConfirmationCode operation.

Source§

impl Client

Source

pub fn respond_to_auth_challenge(&self) -> RespondToAuthChallengeFluentBuilder

Constructs a fluent builder for the RespondToAuthChallenge operation.

  • The fluent builder is configurable:
    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The ID of the app client where the user is signing in.


    • challenge_name(ChallengeNameType) / set_challenge_name(Option<ChallengeNameType>):
      required: true

      The name of the challenge that you are responding to.

      You can’t respond to an ADMIN_NO_SRP_AUTH challenge with this operation.

      Possible challenges include the following:

      All of the following challenges require USERNAME and, when the app client has a client secret, SECRET_HASH in the parameters.

      • WEB_AUTHN: Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and security keys.

      • PASSWORD: Respond with USER_PASSWORD_AUTH parameters: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • PASSWORD_SRP: Respond with USER_SRP_AUTH parameters: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • SELECT_CHALLENGE: Respond to the challenge with USERNAME and an ANSWER that matches one of the challenge types in the AvailableChallenges response parameter.

      • SMS_MFA: Respond with an SMS_MFA_CODE that your user pool delivered in an SMS message.

      • EMAIL_OTP: Respond with an EMAIL_OTP_CODE that your user pool delivered in an email message.

      • PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations.

      • CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued. The parameters of the challenge are determined by your Lambda function.

      • DEVICE_SRP_AUTH: Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device.

      • DEVICE_PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations. For more information, see Signing in with a device.

      • NEW_PASSWORD_REQUIRED: For users who are required to change their passwords after successful first login. Respond to this challenge with NEW_PASSWORD and any required attributes that Amazon Cognito returned in the requiredAttributes parameter. You can also set values for attributes that aren’t required by your user pool and that your app client can write.

        Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes.

        In a NEW_PASSWORD_REQUIRED challenge response, you can’t modify a required attribute that already has a value. In AdminRespondToAuthChallenge or RespondToAuthChallenge, set a value for any keys that Amazon Cognito returned in the requiredAttributes parameter, then use the AdminUpdateUserAttributes or UpdateUserAttributes API operation to modify the value of any additional attributes.

      • MFA_SETUP: For users who are required to setup an MFA factor before they can sign in. The MFA types activated for the user pool will be listed in the challenge parameters MFAS_CAN_SETUP value.

        To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from InitiateAuth or AdminInitiateAuth as an input to AssociateSoftwareToken. Then, use the session returned by VerifySoftwareToken as an input to RespondToAuthChallenge or AdminRespondToAuthChallenge with challenge name MFA_SETUP to complete sign-in.

        To set up SMS or email MFA, collect a phone_number or email attribute for the user. Then restart the authentication flow with an InitiateAuth or AdminInitiateAuth request.


    • session(impl Into<String>) / set_session(Option<String>):
      required: false

      The session identifier that maintains the state of authentication requests and challenge responses. If an AdminInitiateAuth or AdminRespondToAuthChallenge API request results in a determination that your application must pass another challenge, Amazon Cognito returns a session with other challenge parameters. Send this session identifier, unmodified, to the next AdminRespondToAuthChallenge request.


    • challenge_responses(impl Into<String>, impl Into<String>) / set_challenge_responses(Option<HashMap::<String, String>>):
      required: false

      The responses to the challenge that you received in the previous request. Each challenge has its own required response parameters. The following examples are partial JSON request bodies that highlight challenge-response parameters.

      You must provide a SECRET_HASH parameter in all challenge responses to an app client that has a client secret. Include a DEVICE_KEY for device authentication.

      SELECT_CHALLENGE

      “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “USERNAME”: “[username]”, “ANSWER”: “[Challenge name]”}

      Available challenges are PASSWORD, PASSWORD_SRP, EMAIL_OTP, SMS_OTP, and WEB_AUTHN.

      Complete authentication in the SELECT_CHALLENGE response for PASSWORD, PASSWORD_SRP, and WEB_AUTHN:

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “WEB_AUTHN”, “USERNAME”: “[username]”, “CREDENTIAL”: “[AuthenticationResponseJSON]”}

        See AuthenticationResponseJSON.

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “PASSWORD”, “USERNAME”: “[username]”, “PASSWORD”: “[password]”}

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “PASSWORD_SRP”, “USERNAME”: “[username]”, “SRP_A”: “[SRP_A]”}

      For SMS_OTP and EMAIL_OTP, respond with the username and answer. Your user pool will send a code for the user to submit in the next challenge response.

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “SMS_OTP”, “USERNAME”: “[username]”}

      • “ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “EMAIL_OTP”, “USERNAME”: “[username]”}

      SMS_OTP

      “ChallengeName”: “SMS_OTP”, “ChallengeResponses”: {“SMS_OTP_CODE”: “[code]”, “USERNAME”: “[username]”}

      EMAIL_OTP

      “ChallengeName”: “EMAIL_OTP”, “ChallengeResponses”: {“EMAIL_OTP_CODE”: “[code]”, “USERNAME”: “[username]”}

      SMS_MFA

      “ChallengeName”: “SMS_MFA”, “ChallengeResponses”: {“SMS_MFA_CODE”: “[code]”, “USERNAME”: “[username]”}

      PASSWORD_VERIFIER

      This challenge response is part of the SRP flow. Amazon Cognito requires that your application respond to this challenge within a few seconds. When the response time exceeds this period, your user pool returns a NotAuthorizedException error.

      “ChallengeName”: “PASSWORD_VERIFIER”, “ChallengeResponses”: {“PASSWORD_CLAIM_SIGNATURE”: “[claim_signature]”, “PASSWORD_CLAIM_SECRET_BLOCK”: “[secret_block]”, “TIMESTAMP”: [timestamp], “USERNAME”: “[username]”}

      Add “DEVICE_KEY” when you sign in with a remembered device.

      CUSTOM_CHALLENGE

      “ChallengeName”: “CUSTOM_CHALLENGE”, “ChallengeResponses”: {“USERNAME”: “[username]”, “ANSWER”: “[challenge_answer]”}

      Add “DEVICE_KEY” when you sign in with a remembered device.

      NEW_PASSWORD_REQUIRED

      “ChallengeName”: “NEW_PASSWORD_REQUIRED”, “ChallengeResponses”: {“NEW_PASSWORD”: “[new_password]”, “USERNAME”: “[username]”}

      To set any required attributes that InitiateAuth returned in an requiredAttributes parameter, add “userAttributes.[attribute_name]”: “[attribute_value]”. This parameter can also set values for writable attributes that aren’t required by your user pool.

      In a NEW_PASSWORD_REQUIRED challenge response, you can’t modify a required attribute that already has a value. In AdminRespondToAuthChallenge or RespondToAuthChallenge, set a value for any keys that Amazon Cognito returned in the requiredAttributes parameter, then use the AdminUpdateUserAttributes or UpdateUserAttributes API operation to modify the value of any additional attributes.

      SOFTWARE_TOKEN_MFA

      “ChallengeName”: “SOFTWARE_TOKEN_MFA”, “ChallengeResponses”: {“USERNAME”: “[username]”, “SOFTWARE_TOKEN_MFA_CODE”: [authenticator_code]}

      DEVICE_SRP_AUTH

      “ChallengeName”: “DEVICE_SRP_AUTH”, “ChallengeResponses”: {“USERNAME”: “[username]”, “DEVICE_KEY”: “[device_key]”, “SRP_A”: “[srp_a]”}

      DEVICE_PASSWORD_VERIFIER

      “ChallengeName”: “DEVICE_PASSWORD_VERIFIER”, “ChallengeResponses”: {“DEVICE_KEY”: “[device_key]”, “PASSWORD_CLAIM_SIGNATURE”: “[claim_signature]”, “PASSWORD_CLAIM_SECRET_BLOCK”: “[secret_block]”, “TIMESTAMP”: [timestamp], “USERNAME”: “[username]”}

      MFA_SETUP

      “ChallengeName”: “MFA_SETUP”, “ChallengeResponses”: {“USERNAME”: “[username]”}, “SESSION”: “[Session ID from VerifySoftwareToken]”

      SELECT_MFA_TYPE

      “ChallengeName”: “SELECT_MFA_TYPE”, “ChallengeResponses”: {“USERNAME”: “[username]”, “ANSWER”: “[SMS_MFA or SOFTWARE_TOKEN_MFA]”}

      For more information about SECRET_HASH, see Computing secret hash values. For information about DEVICE_KEY, see Working with user devices in your user pool.


    • analytics_metadata(AnalyticsMetadataType) / set_analytics_metadata(Option<AnalyticsMetadataType>):
      required: false

      Information that supports analytics outcomes with Amazon Pinpoint, including the user’s endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number.


    • user_context_data(UserContextDataType) / set_user_context_data(Option<UserContextDataType>):
      required: false

      Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

      For more information, see Collecting data for threat protection in applications.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the RespondToAuthChallenge API action, Amazon Cognito invokes any functions that are assigned to the following triggers: post authentication, pre token generation, define auth challenge, create auth challenge, and verify auth challenge. When Amazon Cognito invokes any of these functions, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your RespondToAuthChallenge request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with RespondToAuthChallengeOutput with field(s):
    • challenge_name(Option<ChallengeNameType>):

      The name of the next challenge that you must respond to.

      Possible challenges include the following:

      All of the following challenges require USERNAME and, when the app client has a client secret, SECRET_HASH in the parameters.

      • WEB_AUTHN: Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and security keys.

      • PASSWORD: Respond with USER_PASSWORD_AUTH parameters: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • PASSWORD_SRP: Respond with USER_SRP_AUTH parameters: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • SELECT_CHALLENGE: Respond to the challenge with USERNAME and an ANSWER that matches one of the challenge types in the AvailableChallenges response parameter.

      • SMS_MFA: Respond with an SMS_MFA_CODE that your user pool delivered in an SMS message.

      • EMAIL_OTP: Respond with an EMAIL_OTP_CODE that your user pool delivered in an email message.

      • PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations.

      • CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued. The parameters of the challenge are determined by your Lambda function.

      • DEVICE_SRP_AUTH: Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device.

      • DEVICE_PASSWORD_VERIFIER: Respond with PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after client-side SRP calculations. For more information, see Signing in with a device.

      • NEW_PASSWORD_REQUIRED: For users who are required to change their passwords after successful first login. Respond to this challenge with NEW_PASSWORD and any required attributes that Amazon Cognito returned in the requiredAttributes parameter. You can also set values for attributes that aren’t required by your user pool and that your app client can write.

        Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes.

        In a NEW_PASSWORD_REQUIRED challenge response, you can’t modify a required attribute that already has a value. In AdminRespondToAuthChallenge or RespondToAuthChallenge, set a value for any keys that Amazon Cognito returned in the requiredAttributes parameter, then use the AdminUpdateUserAttributes or UpdateUserAttributes API operation to modify the value of any additional attributes.

      • MFA_SETUP: For users who are required to setup an MFA factor before they can sign in. The MFA types activated for the user pool will be listed in the challenge parameters MFAS_CAN_SETUP value.

        To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from InitiateAuth or AdminInitiateAuth as an input to AssociateSoftwareToken. Then, use the session returned by VerifySoftwareToken as an input to RespondToAuthChallenge or AdminRespondToAuthChallenge with challenge name MFA_SETUP to complete sign-in.

        To set up SMS or email MFA, collect a phone_number or email attribute for the user. Then restart the authentication flow with an InitiateAuth or AdminInitiateAuth request.

    • session(Option<String>):

      The session identifier that maintains the state of authentication requests and challenge responses. If an InitiateAuth or RespondToAuthChallenge API request results in a determination that your application must pass another challenge, Amazon Cognito returns a session with other challenge parameters. Send this session identifier, unmodified, to the next RespondToAuthChallenge request.

    • challenge_parameters(Option<HashMap::<String, String>>):

      The parameters that define your response to the next challenge.

    • authentication_result(Option<AuthenticationResultType>):

      The outcome of a successful authentication process. After your application has passed all challenges, Amazon Cognito returns an AuthenticationResult with the JSON web tokens (JWTs) that indicate successful sign-in.

  • On failure, responds with SdkError<RespondToAuthChallengeError>
Source§

impl Client

Source

pub fn revoke_token(&self) -> RevokeTokenFluentBuilder

Constructs a fluent builder for the RevokeToken operation.

Source§

impl Client

Source

pub fn set_log_delivery_configuration( &self, ) -> SetLogDeliveryConfigurationFluentBuilder

Constructs a fluent builder for the SetLogDeliveryConfiguration operation.

Source§

impl Client

Source

pub fn set_risk_configuration(&self) -> SetRiskConfigurationFluentBuilder

Constructs a fluent builder for the SetRiskConfiguration operation.

Source§

impl Client

Source

pub fn set_ui_customization(&self) -> SetUICustomizationFluentBuilder

Constructs a fluent builder for the SetUICustomization operation.

Source§

impl Client

Source

pub fn set_user_mfa_preference(&self) -> SetUserMFAPreferenceFluentBuilder

Constructs a fluent builder for the SetUserMFAPreference operation.

Source§

impl Client

Source

pub fn set_user_pool_mfa_config(&self) -> SetUserPoolMfaConfigFluentBuilder

Constructs a fluent builder for the SetUserPoolMfaConfig operation.

Source§

impl Client

Source

pub fn set_user_settings(&self) -> SetUserSettingsFluentBuilder

Constructs a fluent builder for the SetUserSettings operation.

Source§

impl Client

Source

pub fn sign_up(&self) -> SignUpFluentBuilder

Constructs a fluent builder for the SignUp operation.

  • The fluent builder is configurable:
    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The ID of the app client where the user wants to sign up.


    • secret_hash(impl Into<String>) / set_secret_hash(Option<String>):
      required: false

      A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message. For more information about SecretHash, see Computing secret hash values.


    • username(impl Into<String>) / set_username(Option<String>):
      required: true

      The username of the user that you want to sign up. The value of this parameter is typically a username, but can be any alias attribute in your user pool.


    • password(impl Into<String>) / set_password(Option<String>):
      required: false

      The user’s proposed password. The password must comply with the password requirements of your user pool.

      Users can sign up without a password when your user pool supports passwordless sign-in with email or SMS OTPs. To create a user with no password, omit this parameter or submit a blank value. You can only create a passwordless user when passwordless sign-in is available.


    • user_attributes(AttributeType) / set_user_attributes(Option<Vec::<AttributeType>>):
      required: false

      An array of name-value pairs representing user attributes.

      For custom attributes, include a custom: prefix in the attribute name, for example custom:department.


    • validation_data(AttributeType) / set_validation_data(Option<Vec::<AttributeType>>):
      required: false

      Temporary user attributes that contribute to the outcomes of your pre sign-up Lambda trigger. This set of key-value pairs are for custom validation of information that you collect from your users but don’t need to retain.

      Your Lambda function can analyze this additional data and act on it. Your function can automatically confirm and verify select users or perform external API operations like logging user attributes and validation data to Amazon CloudWatch Logs.

      For more information about the pre sign-up Lambda trigger, see Pre sign-up Lambda trigger.


    • analytics_metadata(AnalyticsMetadataType) / set_analytics_metadata(Option<AnalyticsMetadataType>):
      required: false

      Information that supports analytics outcomes with Amazon Pinpoint, including the user’s endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number.


    • user_context_data(UserContextDataType) / set_user_context_data(Option<UserContextDataType>):
      required: false

      Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

      For more information, see Collecting data for threat protection in applications.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the SignUp API action, Amazon Cognito invokes any functions that are assigned to the following triggers: pre sign-up, custom message, and post confirmation. When Amazon Cognito invokes any of these functions, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your SignUp request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with SignUpOutput with field(s):
    • user_confirmed(bool):

      Indicates whether the user was automatically confirmed. You can auto-confirm users with a pre sign-up Lambda trigger.

    • code_delivery_details(Option<CodeDeliveryDetailsType>):

      In user pools that automatically verify and confirm new users, Amazon Cognito sends users a message with a code or link that confirms ownership of the phone number or email address that they entered. The CodeDeliveryDetails object is information about the delivery destination for that link or code.

    • user_sub(String):

      The unique identifier of the new user, for example a1b2c3d4-5678-90ab-cdef-EXAMPLE11111.

    • session(Option<String>):

      A session Id that you can pass to ConfirmSignUp when you want to immediately sign in your user with the USER_AUTH flow after they complete sign-up.

  • On failure, responds with SdkError<SignUpError>
Source§

impl Client

Source

pub fn start_user_import_job(&self) -> StartUserImportJobFluentBuilder

Constructs a fluent builder for the StartUserImportJob operation.

Source§

impl Client

Source

pub fn start_web_authn_registration( &self, ) -> StartWebAuthnRegistrationFluentBuilder

Constructs a fluent builder for the StartWebAuthnRegistration operation.

Source§

impl Client

Source

pub fn stop_user_import_job(&self) -> StopUserImportJobFluentBuilder

Constructs a fluent builder for the StopUserImportJob operation.

Source§

impl Client

Source

pub fn tag_resource(&self) -> TagResourceFluentBuilder

Constructs a fluent builder for the TagResource operation.

Source§

impl Client

Source

pub fn untag_resource(&self) -> UntagResourceFluentBuilder

Constructs a fluent builder for the UntagResource operation.

Source§

impl Client

Source

pub fn update_auth_event_feedback(&self) -> UpdateAuthEventFeedbackFluentBuilder

Constructs a fluent builder for the UpdateAuthEventFeedback operation.

Source§

impl Client

Source

pub fn update_device_status(&self) -> UpdateDeviceStatusFluentBuilder

Constructs a fluent builder for the UpdateDeviceStatus operation.

Source§

impl Client

Source

pub fn update_group(&self) -> UpdateGroupFluentBuilder

Constructs a fluent builder for the UpdateGroup operation.

  • The fluent builder is configurable:
    • group_name(impl Into<String>) / set_group_name(Option<String>):
      required: true

      The name of the group that you want to update.


    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool that contains the group you want to update.


    • description(impl Into<String>) / set_description(Option<String>):
      required: false

      A new description of the existing group.


    • role_arn(impl Into<String>) / set_role_arn(Option<String>):
      required: false

      The Amazon Resource Name (ARN) of an IAM role that you want to associate with the group. The role assignment contributes to the cognito:roles and cognito:preferred_role claims in group members’ tokens.


    • precedence(i32) / set_precedence(Option<i32>):
      required: false

      A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower Precedence values take precedence over groups with higher or null Precedence values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user’s tokens for the cognito:roles and cognito:preferred_role claims.

      Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim isn’t set in users’ tokens.

      The default Precedence value is null. The maximum Precedence value is 2^31-1.


  • On success, responds with UpdateGroupOutput with field(s):
  • On failure, responds with SdkError<UpdateGroupError>
Source§

impl Client

Source

pub fn update_identity_provider(&self) -> UpdateIdentityProviderFluentBuilder

Constructs a fluent builder for the UpdateIdentityProvider operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The Id of the user pool where you want to update your IdP.


    • provider_name(impl Into<String>) / set_provider_name(Option<String>):
      required: true

      The name of the IdP that you want to update. You can pass the identity provider name in the identity_provider query parameter of requests to the Authorize endpoint to silently redirect to sign-in with the associated IdP.


    • provider_details(impl Into<String>, impl Into<String>) / set_provider_details(Option<HashMap::<String, String>>):
      required: false

      The scopes, URLs, and identifiers for your external identity provider. The following examples describe the provider detail keys for each IdP type. These values and their schema are subject to change. Social IdP authorize_scopes values must match the values listed here.

      OpenID Connect (OIDC)

      Amazon Cognito accepts the following elements when it can’t discover endpoint URLs from oidc_issuer: attributes_url, authorize_url, jwks_uri, token_url.

      Create or update request: “ProviderDetails”: { “attributes_request_method”: “GET”, “attributes_url”: “https://auth.example.com/userInfo”, “authorize_scopes”: “openid profile email”, “authorize_url”: “https://auth.example.com/authorize”, “client_id”: “1example23456789”, “client_secret”: “provider-app-client-secret”, “jwks_uri”: “https://auth.example.com/.well-known/jwks.json”, “oidc_issuer”: “https://auth.example.com”, “token_url”: “https://example.com/token” }

      Describe response: “ProviderDetails”: { “attributes_request_method”: “GET”, “attributes_url”: “https://auth.example.com/userInfo”, “attributes_url_add_attributes”: “false”, “authorize_scopes”: “openid profile email”, “authorize_url”: “https://auth.example.com/authorize”, “client_id”: “1example23456789”, “client_secret”: “provider-app-client-secret”, “jwks_uri”: “https://auth.example.com/.well-known/jwks.json”, “oidc_issuer”: “https://auth.example.com”, “token_url”: “https://example.com/token” }

      SAML

      Create or update request with Metadata URL: “ProviderDetails”: { “IDPInit”: “true”, “IDPSignout”: “true”, “EncryptedResponses” : “true”, “MetadataURL”: “https://auth.example.com/sso/saml/metadata”, “RequestSigningAlgorithm”: “rsa-sha256” }

      Create or update request with Metadata file: “ProviderDetails”: { “IDPInit”: “true”, “IDPSignout”: “true”, “EncryptedResponses” : “true”, “MetadataFile”: “[metadata XML]”, “RequestSigningAlgorithm”: “rsa-sha256” }

      The value of MetadataFile must be the plaintext metadata document with all quote (“) characters escaped by backslashes.

      Describe response: “ProviderDetails”: { “IDPInit”: “true”, “IDPSignout”: “true”, “EncryptedResponses” : “true”, “ActiveEncryptionCertificate”: “[certificate]”, “MetadataURL”: “https://auth.example.com/sso/saml/metadata”, “RequestSigningAlgorithm”: “rsa-sha256”, “SLORedirectBindingURI”: “https://auth.example.com/slo/saml”, “SSORedirectBindingURI”: “https://auth.example.com/sso/saml” }

      LoginWithAmazon

      Create or update request: “ProviderDetails”: { “authorize_scopes”: “profile postal_code”, “client_id”: “amzn1.application-oa2-client.1example23456789”, “client_secret”: “provider-app-client-secret”

      Describe response: “ProviderDetails”: { “attributes_url”: “https://api.amazon.com/user/profile”, “attributes_url_add_attributes”: “false”, “authorize_scopes”: “profile postal_code”, “authorize_url”: “https://www.amazon.com/ap/oa”, “client_id”: “amzn1.application-oa2-client.1example23456789”, “client_secret”: “provider-app-client-secret”, “token_request_method”: “POST”, “token_url”: “https://api.amazon.com/auth/o2/token” }

      Google

      Create or update request: “ProviderDetails”: { “authorize_scopes”: “email profile openid”, “client_id”: “1example23456789.apps.googleusercontent.com”, “client_secret”: “provider-app-client-secret” }

      Describe response: “ProviderDetails”: { “attributes_url”: “https://people.googleapis.com/v1/people/me?personFields=”, “attributes_url_add_attributes”: “true”, “authorize_scopes”: “email profile openid”, “authorize_url”: “https://accounts.google.com/o/oauth2/v2/auth”, “client_id”: “1example23456789.apps.googleusercontent.com”, “client_secret”: “provider-app-client-secret”, “oidc_issuer”: “https://accounts.google.com”, “token_request_method”: “POST”, “token_url”: “https://www.googleapis.com/oauth2/v4/token” }

      SignInWithApple

      Create or update request: “ProviderDetails”: { “authorize_scopes”: “email name”, “client_id”: “com.example.cognito”, “private_key”: “1EXAMPLE”, “key_id”: “2EXAMPLE”, “team_id”: “3EXAMPLE” }

      Describe response: “ProviderDetails”: { “attributes_url_add_attributes”: “false”, “authorize_scopes”: “email name”, “authorize_url”: “https://appleid.apple.com/auth/authorize”, “client_id”: “com.example.cognito”, “key_id”: “1EXAMPLE”, “oidc_issuer”: “https://appleid.apple.com”, “team_id”: “2EXAMPLE”, “token_request_method”: “POST”, “token_url”: “https://appleid.apple.com/auth/token” }

      Facebook

      Create or update request: “ProviderDetails”: { “api_version”: “v17.0”, “authorize_scopes”: “public_profile, email”, “client_id”: “1example23456789”, “client_secret”: “provider-app-client-secret” }

      Describe response: “ProviderDetails”: { “api_version”: “v17.0”, “attributes_url”: “https://graph.facebook.com/v17.0/me?fields=”, “attributes_url_add_attributes”: “true”, “authorize_scopes”: “public_profile, email”, “authorize_url”: “https://www.facebook.com/v17.0/dialog/oauth”, “client_id”: “1example23456789”, “client_secret”: “provider-app-client-secret”, “token_request_method”: “GET”, “token_url”: “https://graph.facebook.com/v17.0/oauth/access_token” }


    • attribute_mapping(impl Into<String>, impl Into<String>) / set_attribute_mapping(Option<HashMap::<String, String>>):
      required: false

      A mapping of IdP attributes to standard and custom user pool attributes. Specify a user pool attribute as the key of the key-value pair, and the IdP attribute claim name as the value.


    • idp_identifiers(impl Into<String>) / set_idp_identifiers(Option<Vec::<String>>):
      required: false

      An array of IdP identifiers, for example “IdPIdentifiers”: [ “MyIdP”, “MyIdP2” ]. Identifiers are friendly names that you can pass in the idp_identifier query parameter of requests to the Authorize endpoint to silently redirect to sign-in with the associated IdP. Identifiers in a domain format also enable the use of email-address matching with SAML providers.


  • On success, responds with UpdateIdentityProviderOutput with field(s):
  • On failure, responds with SdkError<UpdateIdentityProviderError>
Source§

impl Client

Source

pub fn update_managed_login_branding( &self, ) -> UpdateManagedLoginBrandingFluentBuilder

Constructs a fluent builder for the UpdateManagedLoginBranding operation.

Source§

impl Client

Source

pub fn update_resource_server(&self) -> UpdateResourceServerFluentBuilder

Constructs a fluent builder for the UpdateResourceServer operation.

Source§

impl Client

Source

pub fn update_user_attributes(&self) -> UpdateUserAttributesFluentBuilder

Constructs a fluent builder for the UpdateUserAttributes operation.

  • The fluent builder is configurable:
    • user_attributes(AttributeType) / set_user_attributes(Option<Vec::<AttributeType>>):
      required: true

      An array of name-value pairs representing user attributes.

      For custom attributes, you must add a custom: prefix to the attribute name.

      If you have set an attribute to require verification before Amazon Cognito updates its value, this request doesn’t immediately update the value of that attribute. After your user receives and responds to a verification message to verify the new value, Amazon Cognito updates the attribute value. Your user can sign in and receive messages with the original attribute value until they verify the new value.


    • access_token(impl Into<String>) / set_access_token(Option<String>):
      required: true

      A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for aws.cognito.signin.user.admin.


    • client_metadata(impl Into<String>, impl Into<String>) / set_client_metadata(Option<HashMap::<String, String>>):
      required: false

      A map of custom key-value pairs that you can provide as input for any custom workflows that this action initiates.

      You create custom workflows by assigning Lambda functions to user pool triggers. When you use the UpdateUserAttributes API action, Amazon Cognito invokes the function that is assigned to the custom message trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your UpdateUserAttributes request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

      For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.

      When you use the ClientMetadata parameter, note that Amazon Cognito won’t do the following:

      • Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn’t include triggers, the ClientMetadata parameter serves no purpose.

      • Validate the ClientMetadata value.

      • Encrypt the ClientMetadata value. Don’t send sensitive information in this parameter.


  • On success, responds with UpdateUserAttributesOutput with field(s):
  • On failure, responds with SdkError<UpdateUserAttributesError>
Source§

impl Client

Source

pub fn update_user_pool(&self) -> UpdateUserPoolFluentBuilder

Constructs a fluent builder for the UpdateUserPool operation.

Source§

impl Client

Source

pub fn update_user_pool_client(&self) -> UpdateUserPoolClientFluentBuilder

Constructs a fluent builder for the UpdateUserPoolClient operation.

  • The fluent builder is configurable:
    • user_pool_id(impl Into<String>) / set_user_pool_id(Option<String>):
      required: true

      The ID of the user pool where you want to update the app client.


    • client_id(impl Into<String>) / set_client_id(Option<String>):
      required: true

      The ID of the app client that you want to update.


    • client_name(impl Into<String>) / set_client_name(Option<String>):
      required: false

      A friendly name for the app client.


    • refresh_token_validity(i32) / set_refresh_token_validity(Option<i32>):
      required: false

      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(i32) / set_access_token_validity(Option<i32>):
      required: false

      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(i32) / set_id_token_validity(Option<i32>):
      required: false

      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(TokenValidityUnitsType) / set_token_validity_units(Option<TokenValidityUnitsType>):
      required: false

      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(impl Into<String>) / set_read_attributes(Option<Vec::<String>>):
      required: false

      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(impl Into<String>) / set_write_attributes(Option<Vec::<String>>):
      required: false

      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(ExplicitAuthFlowsType) / set_explicit_auth_flows(Option<Vec::<ExplicitAuthFlowsType>>):
      required: false

      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(impl Into<String>) / set_supported_identity_providers(Option<Vec::<String>>):
      required: false

      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_urls(impl Into<String>) / set_callback_urls(Option<Vec::<String>>):
      required: false

      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_urls(impl Into<String>) / set_logout_urls(Option<Vec::<String>>):
      required: false

      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(impl Into<String>) / set_default_redirect_uri(Option<String>):
      required: false

      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(OAuthFlowType) / set_allowed_o_auth_flows(Option<Vec::<OAuthFlowType>>):
      required: false

      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(impl Into<String>) / set_allowed_o_auth_scopes(Option<Vec::<String>>):
      required: false

      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(bool) / set_allowed_o_auth_flows_user_pool_client(Option<bool>):
      required: false

      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(AnalyticsConfigurationType) / set_analytics_configuration(Option<AnalyticsConfigurationType>):
      required: false

      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(PreventUserExistenceErrorTypes) / set_prevent_user_existence_errors(Option<PreventUserExistenceErrorTypes>):
      required: false

      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(bool) / set_enable_token_revocation(Option<bool>):
      required: false

      Activates or deactivates token revocation in the target app client.


    • enable_propagate_additional_user_context_data(bool) / set_enable_propagate_additional_user_context_data(Option<bool>):
      required: false

      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(i32) / set_auth_session_validity(Option<i32>):
      required: false

      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(RefreshTokenRotationType) / set_refresh_token_rotation(Option<RefreshTokenRotationType>):
      required: false

      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.


  • On success, responds with UpdateUserPoolClientOutput with field(s):
  • On failure, responds with SdkError<UpdateUserPoolClientError>
Source§

impl Client

Source

pub fn update_user_pool_domain(&self) -> UpdateUserPoolDomainFluentBuilder

Constructs a fluent builder for the UpdateUserPoolDomain operation.

  • The fluent builder is configurable:
  • On success, responds with UpdateUserPoolDomainOutput with field(s):
    • managed_login_version(Option<i32>):

      A version number that indicates the state of managed login for your domain. Version 1 is hosted UI (classic). Version 2 is the newer managed login with the branding designer. For more information, see Managed login.

    • cloud_front_domain(Option<String>):

      The fully-qualified domain name (FQDN) of the Amazon CloudFront distribution that hosts your managed login or classic hosted UI pages. You domain-name authority must have an alias record that points requests for your custom domain to this FQDN. Amazon Cognito returns this value if you set a custom domain with CustomDomainConfig. If you set an Amazon Cognito prefix domain, this operation returns a blank response.

  • On failure, responds with SdkError<UpdateUserPoolDomainError>
Source§

impl Client

Source

pub fn verify_software_token(&self) -> VerifySoftwareTokenFluentBuilder

Constructs a fluent builder for the VerifySoftwareToken operation.

Source§

impl Client

Source

pub fn verify_user_attribute(&self) -> VerifyUserAttributeFluentBuilder

Constructs a fluent builder for the VerifyUserAttribute operation.

Source§

impl Client

Source

pub fn from_conf(conf: Config) -> Self

Creates a new client from the service Config.

§Panics

This method will panic in the following cases:

  • Retries or timeouts are enabled without a sleep_impl configured.
  • Identity caching is enabled without a sleep_impl and time_source configured.
  • No behavior_version is provided.

The panic message for each of these will have instructions on how to resolve them.

Source

pub fn config(&self) -> &Config

Returns the client’s configuration.

Source§

impl Client

Source

pub fn new(sdk_config: &SdkConfig) -> Self

Creates a new client from an SDK Config.

§Panics
  • This method will panic if the sdk_config is missing an async sleep implementation. If you experience this panic, set the sleep_impl on the Config passed into this function to fix it.
  • This method will panic if the sdk_config is missing an HTTP connector. If you experience this panic, set the http_connector on the Config passed into this function to fix it.
  • This method will panic if no BehaviorVersion is provided. If you experience this panic, set behavior_version on the Config or enable the behavior-version-latest Cargo feature.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Paint for T
where T: ?Sized,

Source§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
Source§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
Source§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
Source§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
Source§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling Attribute value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
Source§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
Source§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi Quirk value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
Source§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
Source§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
Source§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the Condition value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,