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
impl Client
Sourcepub fn add_custom_attributes(&self) -> AddCustomAttributesFluentBuilder
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: trueThe ID of the user pool where you want to add custom attributes.
custom_attributes(SchemaAttributeType)
/set_custom_attributes(Option<Vec::<SchemaAttributeType>>)
:
required: trueAn 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
, entermyAttribute
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
impl Client
Sourcepub fn admin_add_user_to_group(&self) -> AdminAddUserToGroupFluentBuilder
pub fn admin_add_user_to_group(&self) -> AdminAddUserToGroupFluentBuilder
Constructs a fluent builder for the AdminAddUserToGroup
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the group that you want to add the user to.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: trueThe name of the group that you want to add your user to.
- On success, responds with
AdminAddUserToGroupOutput
- On failure, responds with
SdkError<AdminAddUserToGroupError>
Source§impl Client
impl Client
Sourcepub fn admin_confirm_sign_up(&self) -> AdminConfirmSignUpFluentBuilder
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: trueThe 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: trueThe 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 thesub
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: falseA 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, theClientMetadata
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
impl Client
Sourcepub fn admin_create_user(&self) -> AdminCreateUserFluentBuilder
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: trueThe ID of the user pool where you want to create a user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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: falseAn 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 toAdminCreateUser
) 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 theemail_verified
andphone_number_verified
attributes totrue
. The following conditions apply:-
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 setemail_verified
totrue
, or if you setEMAIL
in theDesiredDeliveryMediums
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 setphone_number_verified
totrue
, or if you setSMS
in theDesiredDeliveryMediums
parameter.
validation_data(AttributeType)
/set_validation_data(Option<Vec::<AttributeType>>)
:
required: falseTemporary 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: falseThe 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 specifyRESEND
for theMessageAction
parameter.force_alias_creation(bool)
/set_force_alias_creation(Option<bool>)
:
required: falseThis parameter is used only if the
phone_number_verified
oremail_verified
attribute is set toTrue
. Otherwise, it is ignored.If this parameter is set to
True
and the phone number or email address specified in theUserAttributes
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 anAliasExistsException
error if the alias already exists. The default value isFalse
.message_action(MessageActionType)
/set_message_action(Option<MessageActionType>)
:
required: falseSet 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 toSUPPRESS
to suppress sending the message. You can specify only one value.desired_delivery_mediums(DeliveryMediumType)
/set_desired_delivery_mediums(Option<Vec::<DeliveryMediumType>>)
:
required: falseSpecify
EMAIL
if email will be used to send the welcome message. SpecifySMS
if the phone number will be used. The default value isSMS
. You can specify more than one value.client_metadata(impl Into<String>, impl Into<String>)
/set_client_metadata(Option<HashMap::<String, String>>)
:
required: falseA 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 theclientMetadata
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, theClientMetadata
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):user(Option<UserType>)
:The new user’s profile details.
- On failure, responds with
SdkError<AdminCreateUserError>
Source§impl Client
impl Client
Sourcepub fn admin_delete_user(&self) -> AdminDeleteUserFluentBuilder
pub fn admin_delete_user(&self) -> AdminDeleteUserFluentBuilder
Constructs a fluent builder for the AdminDeleteUser
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to delete the user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.
- On success, responds with
AdminDeleteUserOutput
- On failure, responds with
SdkError<AdminDeleteUserError>
Source§impl Client
impl Client
Sourcepub fn admin_delete_user_attributes(
&self,
) -> AdminDeleteUserAttributesFluentBuilder
pub fn admin_delete_user_attributes( &self, ) -> AdminDeleteUserAttributesFluentBuilder
Constructs a fluent builder for the AdminDeleteUserAttributes
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to delete user attributes.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.user_attribute_names(impl Into<String>)
/set_user_attribute_names(Option<Vec::<String>>)
:
required: trueAn array of strings representing the user attribute names you want to delete.
For custom attributes, you must prepend the
custom:
prefix to the attribute name.
- On success, responds with
AdminDeleteUserAttributesOutput
- On failure, responds with
SdkError<AdminDeleteUserAttributesError>
Source§impl Client
impl Client
Sourcepub fn admin_disable_provider_for_user(
&self,
) -> AdminDisableProviderForUserFluentBuilder
pub fn admin_disable_provider_for_user( &self, ) -> AdminDisableProviderForUserFluentBuilder
Constructs a fluent builder for the AdminDisableProviderForUser
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to delete the user’s linked identities.
user(ProviderUserIdentifierType)
/set_user(Option<ProviderUserIdentifierType>)
:
required: trueThe user profile that you want to delete a linked identity from.
- On success, responds with
AdminDisableProviderForUserOutput
- On failure, responds with
SdkError<AdminDisableProviderForUserError>
Source§impl Client
impl Client
Sourcepub fn admin_disable_user(&self) -> AdminDisableUserFluentBuilder
pub fn admin_disable_user(&self) -> AdminDisableUserFluentBuilder
Constructs a fluent builder for the AdminDisableUser
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to disable the user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.
- On success, responds with
AdminDisableUserOutput
- On failure, responds with
SdkError<AdminDisableUserError>
Source§impl Client
impl Client
Sourcepub fn admin_enable_user(&self) -> AdminEnableUserFluentBuilder
pub fn admin_enable_user(&self) -> AdminEnableUserFluentBuilder
Constructs a fluent builder for the AdminEnableUser
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to activate sign-in for the user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.
- On success, responds with
AdminEnableUserOutput
- On failure, responds with
SdkError<AdminEnableUserError>
Source§impl Client
impl Client
Sourcepub fn admin_forget_device(&self) -> AdminForgetDeviceFluentBuilder
pub fn admin_forget_device(&self) -> AdminForgetDeviceFluentBuilder
Constructs a fluent builder for the AdminForgetDevice
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where the device owner is a user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.device_key(impl Into<String>)
/set_device_key(Option<String>)
:
required: trueThe key ID of the device that you want to delete.
- On success, responds with
AdminForgetDeviceOutput
- On failure, responds with
SdkError<AdminForgetDeviceError>
Source§impl Client
impl Client
Sourcepub fn admin_get_device(&self) -> AdminGetDeviceFluentBuilder
pub fn admin_get_device(&self) -> AdminGetDeviceFluentBuilder
Constructs a fluent builder for the AdminGetDevice
operation.
- The fluent builder is configurable:
device_key(impl Into<String>)
/set_device_key(Option<String>)
:
required: trueThe key of the device that you want to delete.
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where the device owner is a user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.
- On success, responds with
AdminGetDeviceOutput
with field(s):device(Option<DeviceType>)
:Details of the requested device. Includes device information, last-accessed and created dates, and the device key.
- On failure, responds with
SdkError<AdminGetDeviceError>
Source§impl Client
impl Client
Sourcepub fn admin_get_user(&self) -> AdminGetUserFluentBuilder
pub fn admin_get_user(&self) -> AdminGetUserFluentBuilder
Constructs a fluent builder for the AdminGetUser
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to get information about the user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.
- 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
, andSOFTWARE_TOKEN_MFA
.
- On failure, responds with
SdkError<AdminGetUserError>
Source§impl Client
impl Client
Sourcepub fn admin_initiate_auth(&self) -> AdminInitiateAuthFluentBuilder
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: trueThe ID of the user pool where the user wants to sign in.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe ID of the app client where the user wants to sign in.
auth_flow(AuthFlowType)
/set_auth_flow(Option<AuthFlowType>)
:
required: trueThe authentication flow that you want to initiate. Each
AuthFlow
has linkedAuthParameters
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: falseThe authentication parameters. These are inputs corresponding to the
AuthFlow
that you’re invoking. The required values depend on the value ofAuthFlow
for example:-
For
USER_AUTH
:USERNAME
(required),PREFERRED_CHALLENGE
. If you don’t provide a value forPREFERRED_CHALLENGE
, Amazon Cognito responds with theAvailableChallenges
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, includeChallengeName: SRP_A
andSRP_A: (The SRP_A Value)
.
For more information about
SECRET_HASH
, see Computing secret hash values. For information aboutDEVICE_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: falseA 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 thevalidationData
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, theClientMetadata
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: falseInformation 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: falseContextual 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: falseThe optional session ID from a
ConfirmSignUp
API request. You can sign in a user directly from the sign-up process with anAuthFlow
ofUSER_AUTH
andAuthParameters
ofEMAIL_OTP
orSMS_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 withUSER_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 withUSER_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 withUSERNAME
and anANSWER
that matches one of the challenge types in theAvailableChallenges
response parameter. -
SMS_MFA
: Respond with anSMS_MFA_CODE
that your user pool delivered in an SMS message. -
EMAIL_OTP
: Respond with anEMAIL_OTP_CODE
that your user pool delivered in an email message. -
PASSWORD_VERIFIER
: Respond withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withNEW_PASSWORD
and any required attributes that Amazon Cognito returned in therequiredAttributes
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. InAdminRespondToAuthChallenge
orRespondToAuthChallenge
, set a value for any keys that Amazon Cognito returned in therequiredAttributes
parameter, then use theAdminUpdateUserAttributes
orUpdateUserAttributes
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 parametersMFAS_CAN_SETUP
value.To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from
InitiateAuth
orAdminInitiateAuth
as an input toAssociateSoftwareToken
. Then, use the session returned byVerifySoftwareToken
as an input toRespondToAuthChallenge
orAdminRespondToAuthChallenge
with challenge nameMFA_SETUP
to complete sign-in.To set up SMS or email MFA, collect a
phone_number
oremail
attribute for the user. Then restart the authentication flow with anInitiateAuth
orAdminInitiateAuth
request.
-
session(Option<String>)
:The session that must be passed to challenge-response requests. If an
AdminInitiateAuth
orAdminRespondToAuthChallenge
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 theSession
parameter ofAdminRespondToAuthChallenge
.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 theChallengeParameters
ofAdminRespondToAuthChallenge
.All challenges require
USERNAME
and, when the app client has a client secret,SECRET_HASH
.In SRP challenges, Amazon Cognito returns the
username
attribute inUSER_ID_FOR_SRP
instead of any email address, preferred username, or phone number alias that you might have specified in yourAdminInitiateAuth
request. You must use the username and not an alias in theChallengeResponses
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
, andSession
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
impl Client
Sourcepub fn admin_link_provider_for_user(
&self,
) -> AdminLinkProviderForUserFluentBuilder
pub fn admin_link_provider_for_user( &self, ) -> AdminLinkProviderForUserFluentBuilder
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: trueThe ID of the user pool where you want to link a federated identity.
destination_user(ProviderUserIdentifierType)
/set_destination_user(Option<ProviderUserIdentifierType>)
:
required: trueThe 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 theDestinationUser
should be the username in the user pool. For a federated user, it should be the provider-specificuser_id
.The
ProviderAttributeName
of theDestinationUser
is ignored.The
ProviderName
should be set toCognito
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: trueAn 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 theProviderAttributeName
toCognito_Subject
. For social IdPs, theProviderName
will beFacebook
,Google
, orLoginWithAmazon
, and Amazon Cognito will automatically parse the Facebook, Google, and Login with Amazon tokens forid
,sub
, anduser_id
, respectively. TheProviderAttributeValue
for the user must be the same value as theid
,sub
, oruser_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 theuserInfo
endpoint. For SAML, theProviderAttributeName
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 yourAdminLinkProviderForUser
request. For example,email
. -
When you set
ProviderAttributeName
toCognito_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
impl Client
Sourcepub fn admin_list_devices(&self) -> AdminListDevicesFluentBuilder
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: trueThe ID of the user pool where the device owner is a user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.limit(i32)
/set_limit(Option<i32>)
:
required: falseThe 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: falseThis 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
impl Client
Sourcepub fn admin_list_groups_for_user(&self) -> AdminListGroupsForUserFluentBuilder
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: trueThe 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 thesub
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: trueThe ID of the user pool where you want to view a user’s groups.
limit(i32)
/set_limit(Option<i32>)
:
required: falseThe 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: falseThis 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
impl Client
Sourcepub fn admin_list_user_auth_events(
&self,
) -> AdminListUserAuthEventsFluentBuilder
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: trueThe Id of the user pool that contains the user profile with the logged events.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of authentication events to return. Returns 60 events if you set
MaxResults
to 0, or if you don’t include aMaxResults
parameter.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThis 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
, andEventResponse
.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
impl Client
Sourcepub fn admin_remove_user_from_group(
&self,
) -> AdminRemoveUserFromGroupFluentBuilder
pub fn admin_remove_user_from_group( &self, ) -> AdminRemoveUserFromGroupFluentBuilder
Constructs a fluent builder for the AdminRemoveUserFromGroup
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the group and the user that you want to remove.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: trueThe name of the group that you want to remove the user from, for example
MyTestGroup
.
- On success, responds with
AdminRemoveUserFromGroupOutput
- On failure, responds with
SdkError<AdminRemoveUserFromGroupError>
Source§impl Client
impl Client
Sourcepub fn admin_reset_user_password(&self) -> AdminResetUserPasswordFluentBuilder
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: trueThe ID of the user pool where you want to reset the user’s password.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
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: falseA 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 aclientMetadata
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 theclientMetadata
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, theClientMetadata
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
impl Client
Sourcepub fn admin_respond_to_auth_challenge(
&self,
) -> AdminRespondToAuthChallengeFluentBuilder
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: trueThe 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: trueThe ID of the app client where you initiated sign-in.
challenge_name(ChallengeNameType)
/set_challenge_name(Option<ChallengeNameType>)
:
required: trueThe 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 withUSER_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 withUSER_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 withUSERNAME
and anANSWER
that matches one of the challenge types in theAvailableChallenges
response parameter. -
SMS_MFA
: Respond with anSMS_MFA_CODE
that your user pool delivered in an SMS message. -
EMAIL_OTP
: Respond with anEMAIL_OTP_CODE
that your user pool delivered in an email message. -
PASSWORD_VERIFIER
: Respond withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withNEW_PASSWORD
and any required attributes that Amazon Cognito returned in therequiredAttributes
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. InAdminRespondToAuthChallenge
orRespondToAuthChallenge
, set a value for any keys that Amazon Cognito returned in therequiredAttributes
parameter, then use theAdminUpdateUserAttributes
orUpdateUserAttributes
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 parametersMFAS_CAN_SETUP
value.To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from
InitiateAuth
orAdminInitiateAuth
as an input toAssociateSoftwareToken
. Then, use the session returned byVerifySoftwareToken
as an input toRespondToAuthChallenge
orAdminRespondToAuthChallenge
with challenge nameMFA_SETUP
to complete sign-in.To set up SMS or email MFA, collect a
phone_number
oremail
attribute for the user. Then restart the authentication flow with anInitiateAuth
orAdminInitiateAuth
request.
-
challenge_responses(impl Into<String>, impl Into<String>)
/set_challenge_responses(Option<HashMap::<String, String>>)
:
required: falseThe 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
, andWEB_AUTHN
.Complete authentication in the
SELECT_CHALLENGE
response forPASSWORD
,PASSWORD_SRP
, andWEB_AUTHN
:-
“ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “WEB_AUTHN”, “USERNAME”: “[username]”, “CREDENTIAL”: “[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
andEMAIL_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 anrequiredAttributes
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. InAdminRespondToAuthChallenge
orRespondToAuthChallenge
, set a value for any keys that Amazon Cognito returned in therequiredAttributes
parameter, then use theAdminUpdateUserAttributes
orUpdateUserAttributes
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 aboutDEVICE_KEY
, see Working with user devices in your user pool.session(impl Into<String>)
/set_session(Option<String>)
:
required: falseThe session identifier that maintains the state of authentication requests and challenge responses. If an
AdminInitiateAuth
orAdminRespondToAuthChallenge
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 nextAdminRespondToAuthChallenge
request.analytics_metadata(AnalyticsMetadataType)
/set_analytics_metadata(Option<AnalyticsMetadataType>)
:
required: falseInformation 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: falseContextual 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: falseA 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 theclientMetadata
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, theClientMetadata
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 withUSER_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 withUSER_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 withUSERNAME
and anANSWER
that matches one of the challenge types in theAvailableChallenges
response parameter. -
SMS_MFA
: Respond with anSMS_MFA_CODE
that your user pool delivered in an SMS message. -
EMAIL_OTP
: Respond with anEMAIL_OTP_CODE
that your user pool delivered in an email message. -
PASSWORD_VERIFIER
: Respond withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withNEW_PASSWORD
and any required attributes that Amazon Cognito returned in therequiredAttributes
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. InAdminRespondToAuthChallenge
orRespondToAuthChallenge
, set a value for any keys that Amazon Cognito returned in therequiredAttributes
parameter, then use theAdminUpdateUserAttributes
orUpdateUserAttributes
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 parametersMFAS_CAN_SETUP
value.To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from
InitiateAuth
orAdminInitiateAuth
as an input toAssociateSoftwareToken
. Then, use the session returned byVerifySoftwareToken
as an input toRespondToAuthChallenge
orAdminRespondToAuthChallenge
with challenge nameMFA_SETUP
to complete sign-in.To set up SMS or email MFA, collect a
phone_number
oremail
attribute for the user. Then restart the authentication flow with anInitiateAuth
orAdminInitiateAuth
request.
-
session(Option<String>)
:The session identifier that maintains the state of authentication requests and challenge responses. If an
AdminInitiateAuth
orAdminRespondToAuthChallenge
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 nextAdminRespondToAuthChallenge
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
impl Client
Sourcepub fn admin_set_user_mfa_preference(
&self,
) -> AdminSetUserMFAPreferenceFluentBuilder
pub fn admin_set_user_mfa_preference( &self, ) -> AdminSetUserMFAPreferenceFluentBuilder
Constructs a fluent builder for the AdminSetUserMFAPreference
operation.
- The fluent builder is configurable:
sms_mfa_settings(SmsMfaSettingsType)
/set_sms_mfa_settings(Option<SmsMfaSettingsType>)
:
required: falseUser preferences for SMS message MFA. Activates or deactivates SMS MFA and sets it as the preferred MFA method when multiple methods are available.
software_token_mfa_settings(SoftwareTokenMfaSettingsType)
/set_software_token_mfa_settings(Option<SoftwareTokenMfaSettingsType>)
:
required: falseUser preferences for time-based one-time password (TOTP) MFA. Activates or deactivates TOTP MFA and sets it as the preferred MFA method when multiple methods are available. This operation can set TOTP as a user’s preferred MFA method before they register a TOTP authenticator.
email_mfa_settings(EmailMfaSettingsType)
/set_email_mfa_settings(Option<EmailMfaSettingsType>)
:
required: falseUser preferences for email message MFA. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, your user pool must be in the Essentials tier or higher.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
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: trueThe ID of the user pool where you want to set a user’s MFA preferences.
- On success, responds with
AdminSetUserMfaPreferenceOutput
- On failure, responds with
SdkError<AdminSetUserMFAPreferenceError>
Source§impl Client
impl Client
Sourcepub fn admin_set_user_password(&self) -> AdminSetUserPasswordFluentBuilder
pub fn admin_set_user_password(&self) -> AdminSetUserPasswordFluentBuilder
Constructs a fluent builder for the AdminSetUserPassword
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to set the user’s password.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.password(impl Into<String>)
/set_password(Option<String>)
:
required: trueThe new temporary or permanent password that you want to set for the user. You can’t remove the password for a user who already has a password so that they can only sign in with passwordless methods. In this scenario, you must create a new user without a password.
permanent(bool)
/set_permanent(Option<bool>)
:
required: falseSet to
true
to set a password that the user can immediately sign in with. Set tofalse
to set a temporary password that the user must change on their next sign-in.
- On success, responds with
AdminSetUserPasswordOutput
- On failure, responds with
SdkError<AdminSetUserPasswordError>
Source§impl Client
impl Client
Sourcepub fn admin_set_user_settings(&self) -> AdminSetUserSettingsFluentBuilder
pub fn admin_set_user_settings(&self) -> AdminSetUserSettingsFluentBuilder
Constructs a fluent builder for the AdminSetUserSettings
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the user whose options you’re setting.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.mfa_options(MfaOptionType)
/set_mfa_options(Option<Vec::<MfaOptionType>>)
:
required: trueYou can use this parameter only to set an SMS configuration that uses SMS for delivery.
- On success, responds with
AdminSetUserSettingsOutput
- On failure, responds with
SdkError<AdminSetUserSettingsError>
Source§impl Client
impl Client
Sourcepub fn admin_update_auth_event_feedback(
&self,
) -> AdminUpdateAuthEventFeedbackFluentBuilder
pub fn admin_update_auth_event_feedback( &self, ) -> AdminUpdateAuthEventFeedbackFluentBuilder
Constructs a fluent builder for the AdminUpdateAuthEventFeedback
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to submit authentication-event feedback.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.event_id(impl Into<String>)
/set_event_id(Option<String>)
:
required: trueThe ID of the threat protection authentication event that you want to update.
feedback_value(FeedbackValueType)
/set_feedback_value(Option<FeedbackValueType>)
:
required: trueYour feedback to the authentication event. When you provide a
FeedbackValue
value ofvalid
, you tell Amazon Cognito that you trust a user session where Amazon Cognito has evaluated some level of risk. When you provide aFeedbackValue
value ofinvalid
, you tell Amazon Cognito that you don’t trust a user session, or you don’t believe that Amazon Cognito evaluated a high-enough risk level.
- On success, responds with
AdminUpdateAuthEventFeedbackOutput
- On failure, responds with
SdkError<AdminUpdateAuthEventFeedbackError>
Source§impl Client
impl Client
Sourcepub fn admin_update_device_status(&self) -> AdminUpdateDeviceStatusFluentBuilder
pub fn admin_update_device_status(&self) -> AdminUpdateDeviceStatusFluentBuilder
Constructs a fluent builder for the AdminUpdateDeviceStatus
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to change a user’s device status.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.device_key(impl Into<String>)
/set_device_key(Option<String>)
:
required: trueThe unique identifier, or device key, of the device that you want to update the status for.
device_remembered_status(DeviceRememberedStatusType)
/set_device_remembered_status(Option<DeviceRememberedStatusType>)
:
required: falseTo enable device authentication with the specified device, set to
remembered
.To disable, set tonot_remembered
.
- On success, responds with
AdminUpdateDeviceStatusOutput
- On failure, responds with
SdkError<AdminUpdateDeviceStatusError>
Source§impl Client
impl Client
Sourcepub fn admin_update_user_attributes(
&self,
) -> AdminUpdateUserAttributesFluentBuilder
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: trueThe ID of the user pool where you want to update user attributes.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
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: trueAn 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
orphone_number_verified
attribute, with a value oftrue
. If you set theemail_verified
orphone_number_verified
value for anemail
orphone_number
attribute that requires verification totrue
, 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: falseA 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 theclientMetadata
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, theClientMetadata
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
impl Client
Sourcepub fn admin_user_global_sign_out(&self) -> AdminUserGlobalSignOutFluentBuilder
pub fn admin_user_global_sign_out(&self) -> AdminUserGlobalSignOutFluentBuilder
Constructs a fluent builder for the AdminUserGlobalSignOut
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to sign out a user.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.
- On success, responds with
AdminUserGlobalSignOutOutput
- On failure, responds with
SdkError<AdminUserGlobalSignOutError>
Source§impl Client
impl Client
Sourcepub fn associate_software_token(&self) -> AssociateSoftwareTokenFluentBuilder
pub fn associate_software_token(&self) -> AssociateSoftwareTokenFluentBuilder
Constructs a fluent builder for the AssociateSoftwareToken
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: falseA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.You can provide either an access token or a session ID in the request.
session(impl Into<String>)
/set_session(Option<String>)
:
required: falseThe session identifier that maintains the state of authentication requests and challenge responses. In
AssociateSoftwareToken
, this is the session ID from a successful sign-in. You can provide either an access token or a session ID in the request.
- On success, responds with
AssociateSoftwareTokenOutput
with field(s):secret_code(Option<String>)
:A unique generated shared secret code that is used by the TOTP algorithm to generate a one-time code.
session(Option<String>)
:The session identifier that maintains the state of authentication requests and challenge responses.
- On failure, responds with
SdkError<AssociateSoftwareTokenError>
Source§impl Client
impl Client
Sourcepub fn change_password(&self) -> ChangePasswordFluentBuilder
pub fn change_password(&self) -> ChangePasswordFluentBuilder
Constructs a fluent builder for the ChangePassword
operation.
- The fluent builder is configurable:
previous_password(impl Into<String>)
/set_previous_password(Option<String>)
:
required: falseThe user’s previous password. Required if the user has a password. If the user has no password and only signs in with passwordless authentication options, you can omit this parameter.
proposed_password(impl Into<String>)
/set_proposed_password(Option<String>)
:
required: trueA new password that you prompted the user to enter in your application.
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the user whose password you want to change.
- On success, responds with
ChangePasswordOutput
- On failure, responds with
SdkError<ChangePasswordError>
Source§impl Client
impl Client
Sourcepub fn complete_web_authn_registration(
&self,
) -> CompleteWebAuthnRegistrationFluentBuilder
pub fn complete_web_authn_registration( &self, ) -> CompleteWebAuthnRegistrationFluentBuilder
Constructs a fluent builder for the CompleteWebAuthnRegistration
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.credential(Document)
/set_credential(Option<Document>)
:
required: trueA RegistrationResponseJSON public-key credential response from the user’s passkey provider.
- On success, responds with
CompleteWebAuthnRegistrationOutput
- On failure, responds with
SdkError<CompleteWebAuthnRegistrationError>
Source§impl Client
impl Client
Sourcepub fn confirm_device(&self) -> ConfirmDeviceFluentBuilder
pub fn confirm_device(&self) -> ConfirmDeviceFluentBuilder
Constructs a fluent builder for the ConfirmDevice
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.device_key(impl Into<String>)
/set_device_key(Option<String>)
:
required: trueThe unique identifier, or device key, of the device that you want to update the status for.
device_secret_verifier_config(DeviceSecretVerifierConfigType)
/set_device_secret_verifier_config(Option<DeviceSecretVerifierConfigType>)
:
required: falseThe configuration of the device secret verifier.
device_name(impl Into<String>)
/set_device_name(Option<String>)
:
required: falseA friendly name for the device, for example
MyMobilePhone
.
- On success, responds with
ConfirmDeviceOutput
with field(s):user_confirmation_necessary(bool)
:When
true
, your user must confirm that they want to remember the device. Prompt the user for an answer.When
false
, immediately sets the device as remembered and eligible for device authentication.You can configure your user pool to always remember devices, in which case this response is
false
, or to allow users to opt in, in which case this response istrue
. Configure this option under Device tracking in the Sign-in menu of your user pool.
- On failure, responds with
SdkError<ConfirmDeviceError>
Source§impl Client
impl Client
Sourcepub fn confirm_forgot_password(&self) -> ConfirmForgotPasswordFluentBuilder
pub fn confirm_forgot_password(&self) -> ConfirmForgotPasswordFluentBuilder
Constructs a fluent builder for the ConfirmForgotPassword
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe ID of the app client where the user wants to reset their password. This parameter is an identifier of the client application that users are resetting their password from, but this operation resets users’ irrespective of the app clients they sign in to.
secret_hash(impl Into<String>)
/set_secret_hash(Option<String>)
:
required: falseA 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: trueThe 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 thesub
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: trueThe confirmation code that your user pool delivered when your user requested to reset their password.
password(impl Into<String>)
/set_password(Option<String>)
:
required: trueThe new password that your user wants to set.
analytics_metadata(AnalyticsMetadataType)
/set_analytics_metadata(Option<AnalyticsMetadataType>)
:
required: falseInformation 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: falseContextual 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: falseA 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 ConfirmForgotPassword 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 ConfirmForgotPassword request. In your function code in Lambda, you can process theclientMetadata
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, theClientMetadata
parameter serves no purpose. -
Validate the
ClientMetadata
value. -
Encrypt the
ClientMetadata
value. Don’t send sensitive information in this parameter.
-
- On success, responds with
ConfirmForgotPasswordOutput
- On failure, responds with
SdkError<ConfirmForgotPasswordError>
Source§impl Client
impl Client
Sourcepub fn confirm_sign_up(&self) -> ConfirmSignUpFluentBuilder
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: trueThe ID of the app client associated with the user pool.
secret_hash(impl Into<String>)
/set_secret_hash(Option<String>)
:
required: falseA 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: trueThe 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 thesub
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: trueThe confirmation code that your user pool sent in response to the
SignUp
request.force_alias_creation(bool)
/set_force_alias_creation(Option<bool>)
:
required: falseWhen
true
, forces user confirmation despite any existing aliases. Defaults tofalse
. A value oftrue
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 ofbob@example.com
and email is an alias in your user pool. If the new user also has an email ofbob@example.com
and yourConfirmSignUp
response setsForceAliasCreation
totrue
, the new user can sign in with a username ofbob@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: falseInformation 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: falseContextual 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: falseA 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 theclientMetadata
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, theClientMetadata
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: falseThe optional session ID from a
SignUp
API request. You can sign in a user directly from the sign-up process with theUSER_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
impl Client
Sourcepub fn create_group(&self) -> CreateGroupFluentBuilder
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: trueA 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: trueThe ID of the user pool where you want to create a user group.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA description of the group that you’re creating.
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:
required: falseThe 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 acognito:groups
claim that list all the groups that a user is a member of.precedence(i32)
/set_precedence(Option<i32>)
:
required: falseA 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 nullPrecedence
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 thecognito:roles
andcognito: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 samePrecedence
have the same role ARN, that role is used in thecognito:preferred_role
claim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_role
claim isn’t set in users’ tokens.The default
Precedence
value is null. The maximumPrecedence
value is2^31-1
.
- On success, responds with
CreateGroupOutput
with field(s):group(Option<GroupType>)
:The response object for a created group.
- On failure, responds with
SdkError<CreateGroupError>
Source§impl Client
impl Client
Sourcepub fn create_identity_provider(&self) -> CreateIdentityProviderFluentBuilder
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: trueThe Id of the user pool where you want to create an IdP.
provider_name(impl Into<String>)
/set_provider_name(Option<String>)
:
required: trueThe 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: trueThe 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: trueThe 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” }
-
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” }
-
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: falseA 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: falseAn array of IdP identifiers, for example
“IdPIdentifiers”: [ “MyIdP”, “MyIdP2” ]
. Identifiers are friendly names that you can pass in theidp_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):identity_provider(Option<IdentityProviderType>)
:The details of the new user pool IdP.
- On failure, responds with
SdkError<CreateIdentityProviderError>
Source§impl Client
impl Client
Sourcepub fn create_managed_login_branding(
&self,
) -> CreateManagedLoginBrandingFluentBuilder
pub fn create_managed_login_branding( &self, ) -> CreateManagedLoginBrandingFluentBuilder
Constructs a fluent builder for the CreateManagedLoginBranding
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to create a new branding style.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe app client that you want to create the branding style for. Each style is linked to an app client until you delete it.
use_cognito_provided_values(bool)
/set_use_cognito_provided_values(Option<bool>)
:
required: falseWhen true, applies the default branding style options. These default options are managed by Amazon Cognito. You can modify them later in the branding designer.
When you specify
true
for this option, you must also omit values forSettings
andAssets
in the request.settings(Document)
/set_settings(Option<Document>)
:
required: falseA JSON file, encoded as a
Document
type, with the the settings that you want to apply to your style.assets(AssetType)
/set_assets(Option<Vec::<AssetType>>)
:
required: falseAn array of image files that you want to apply to functions like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.
- On success, responds with
CreateManagedLoginBrandingOutput
with field(s):managed_login_branding(Option<ManagedLoginBrandingType>)
:The details of the branding style that you created.
- On failure, responds with
SdkError<CreateManagedLoginBrandingError>
Source§impl Client
impl Client
Sourcepub fn create_resource_server(&self) -> CreateResourceServerFluentBuilder
pub fn create_resource_server(&self) -> CreateResourceServerFluentBuilder
Constructs a fluent builder for the CreateResourceServer
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to create a resource server.
identifier(impl Into<String>)
/set_identifier(Option<String>)
:
required: trueA unique resource server identifier for the resource server. The identifier can be an API friendly name like
solar-system-data
. You can also set an API URL likehttps://solar-system-data-api.example.com
as your identifier.Amazon Cognito represents scopes in the access token in the format
$resource-server-identifier/$scope
. Longer scope-identifier strings increase the size of your access tokens.name(impl Into<String>)
/set_name(Option<String>)
:
required: trueA friendly name for the resource server.
scopes(ResourceServerScopeType)
/set_scopes(Option<Vec::<ResourceServerScopeType>>)
:
required: falseA list of custom scopes. Each scope is a key-value map with the keys
ScopeName
andScopeDescription
. The name of a custom scope is a combination ofScopeName
and the resource serverName
in this request, for exampleMyResourceServerName/MyScopeName
.
- On success, responds with
CreateResourceServerOutput
with field(s):resource_server(Option<ResourceServerType>)
:The details of the new resource server.
- On failure, responds with
SdkError<CreateResourceServerError>
Source§impl Client
impl Client
Sourcepub fn create_user_import_job(&self) -> CreateUserImportJobFluentBuilder
pub fn create_user_import_job(&self) -> CreateUserImportJobFluentBuilder
Constructs a fluent builder for the CreateUserImportJob
operation.
- The fluent builder is configurable:
job_name(impl Into<String>)
/set_job_name(Option<String>)
:
required: trueA friendly name for the user import job.
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that you want to import users into.
cloud_watch_logs_role_arn(impl Into<String>)
/set_cloud_watch_logs_role_arn(Option<String>)
:
required: trueYou must specify an IAM role that has permission to log import-job results to Amazon CloudWatch Logs. This parameter is the ARN of that role.
- On success, responds with
CreateUserImportJobOutput
with field(s):user_import_job(Option<UserImportJobType>)
:The details of the user import job. Includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload.
- On failure, responds with
SdkError<CreateUserImportJobError>
Source§impl Client
impl Client
Sourcepub fn create_user_pool(&self) -> CreateUserPoolFluentBuilder
pub fn create_user_pool(&self) -> CreateUserPoolFluentBuilder
Constructs a fluent builder for the CreateUserPool
operation.
- The fluent builder is configurable:
pool_name(impl Into<String>)
/set_pool_name(Option<String>)
:
required: trueA friendly name for your user pool.
policies(UserPoolPolicyType)
/set_policies(Option<UserPoolPolicyType>)
:
required: falseThe password policy and sign-in policy in the user pool. The password policy sets options like password complexity requirements and password history. The sign-in policy sets the options available to applications in choice-based authentication.
deletion_protection(DeletionProtectionType)
/set_deletion_protection(Option<DeletionProtectionType>)
:
required: falseWhen active,
DeletionProtection
prevents accidental deletion of your user pool. Before you can delete a user pool that you have protected against deletion, you must deactivate this feature.When you try to delete a protected user pool in a
DeleteUserPool
API request, Amazon Cognito returns anInvalidParameterException
error. To delete a protected user pool, send a newDeleteUserPool
request after you deactivate deletion protection in anUpdateUserPool
API request.lambda_config(LambdaConfigType)
/set_lambda_config(Option<LambdaConfigType>)
:
required: falseA collection of user pool Lambda triggers. Amazon Cognito invokes triggers at several possible stages of authentication operations. Triggers can modify the outcome of the operations that invoked them.
auto_verified_attributes(VerifiedAttributeType)
/set_auto_verified_attributes(Option<Vec::<VerifiedAttributeType>>)
:
required: falseThe attributes that you want your user pool to automatically verify. For more information, see Verifying contact information at sign-up.
alias_attributes(AliasAttributeType)
/set_alias_attributes(Option<Vec::<AliasAttributeType>>)
:
required: falseAttributes supported as an alias for this user pool. For more information about alias attributes, see Customizing sign-in attributes.
username_attributes(UsernameAttributeType)
/set_username_attributes(Option<Vec::<UsernameAttributeType>>)
:
required: falseSpecifies whether a user can use an email address or phone number as a username when they sign up. For more information, see Customizing sign-in attributes.
sms_verification_message(impl Into<String>)
/set_sms_verification_message(Option<String>)
:
required: falseThis parameter is no longer used.
email_verification_message(impl Into<String>)
/set_email_verification_message(Option<String>)
:
required: falseThis parameter is no longer used.
email_verification_subject(impl Into<String>)
/set_email_verification_subject(Option<String>)
:
required: falseThis parameter is no longer used.
verification_message_template(VerificationMessageTemplateType)
/set_verification_message_template(Option<VerificationMessageTemplateType>)
:
required: falseThe template for the verification message that your user pool delivers to users who set an email address or phone number attribute.
Set the email message type that corresponds to your
DefaultEmailOption
selection. ForCONFIRM_WITH_LINK
, specify anEmailMessageByLink
and leaveEmailMessage
blank. ForCONFIRM_WITH_CODE
, specify anEmailMessage
and leaveEmailMessageByLink
blank. When you supply both parameters with either choice, Amazon Cognito returns an error.sms_authentication_message(impl Into<String>)
/set_sms_authentication_message(Option<String>)
:
required: falseThe contents of the SMS message that your user pool sends to users in SMS OTP and MFA authentication.
mfa_configuration(UserPoolMfaType)
/set_mfa_configuration(Option<UserPoolMfaType>)
:
required: falseSets multi-factor authentication (MFA) to be on, off, or optional. When
ON
, all users must set up MFA before they can sign in. WhenOPTIONAL
, your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, chooseOPTIONAL
.When
MfaConfiguration
isOPTIONAL
, managed login doesn’t automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor.user_attribute_update_settings(UserAttributeUpdateSettingsType)
/set_user_attribute_update_settings(Option<UserAttributeUpdateSettingsType>)
:
required: falseThe settings for updates to user attributes. These settings include the property
AttributesRequireVerificationBeforeUpdate
, a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users’ email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers.device_configuration(DeviceConfigurationType)
/set_device_configuration(Option<DeviceConfigurationType>)
:
required: falseThe device-remembering configuration for a user pool. Device remembering or device tracking is a “Remember me on this device” option for user pools that perform authentication with the device key of a trusted device in the back end, instead of a user-provided MFA code. For more information about device authentication, see Working with user devices in your user pool. A null value indicates that you have deactivated device remembering in your user pool.
When you provide a value for any
DeviceConfiguration
field, you activate the Amazon Cognito device-remembering feature. For more information, see Working with devices.email_configuration(EmailConfigurationType)
/set_email_configuration(Option<EmailConfigurationType>)
:
required: falseThe email configuration of your user pool. The email configuration type sets your preferred sending method, Amazon Web Services Region, and sender for messages from your user pool.
sms_configuration(SmsConfigurationType)
/set_sms_configuration(Option<SmsConfigurationType>)
:
required: falseThe settings for your Amazon Cognito user pool to send SMS messages with Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account. For more information see SMS message settings.
user_pool_tags(impl Into<String>, impl Into<String>)
/set_user_pool_tags(Option<HashMap::<String, String>>)
:
required: falseThe tag keys and values to assign to the user pool. A tag is a label that you can use to categorize and manage user pools in different ways, such as by purpose, owner, environment, or other criteria.
admin_create_user_config(AdminCreateUserConfigType)
/set_admin_create_user_config(Option<AdminCreateUserConfigType>)
:
required: falseThe configuration for administrative creation of users. Includes the template for the invitation message for new users, the duration of temporary passwords, and permitting self-service sign-up.
schema(SchemaAttributeType)
/set_schema(Option<Vec::<SchemaAttributeType>>)
:
required: falseAn array of attributes for the new user pool. You can add custom attributes and modify the properties of default attributes. The specifications in this parameter set the required attributes in your user pool. For more information, see Working with user attributes.
user_pool_add_ons(UserPoolAddOnsType)
/set_user_pool_add_ons(Option<UserPoolAddOnsType>)
:
required: falseContains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to
AUDIT
. To configure automatic security responses to potentially unwanted traffic to your user pool, set toENFORCED
.For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier.
username_configuration(UsernameConfigurationType)
/set_username_configuration(Option<UsernameConfigurationType>)
:
required: falseSets the case sensitivity option for sign-in usernames. When
CaseSensitive
isfalse
(case insensitive), users can sign in with any combination of capital and lowercase letters. For example,username
,USERNAME
, orUserName
, or for email,email@example.com
orEMaiL@eXamplE.Com
. For most use cases, set case sensitivity tofalse
as a best practice. When usernames and email addresses are case insensitive, Amazon Cognito treats any variation in case as the same user, and prevents a case variation from being assigned to the same attribute for a different user.When
CaseSensitive
istrue
(case sensitive), Amazon Cognito interpretsUSERNAME
andUserName
as distinct users.This configuration is immutable after you set it.
account_recovery_setting(AccountRecoverySettingType)
/set_account_recovery_setting(Option<AccountRecoverySettingType>)
:
required: falseThe available verified method a user can use to recover their password when they call
ForgotPassword
. You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn’t qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. Email MFA is also disqualifying for account recovery with email. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred over email.As a best practice, configure both
verified_email
andverified_phone_number
, with one having a higher priority than the other.user_pool_tier(UserPoolTierType)
/set_user_pool_tier(Option<UserPoolTierType>)
:
required: falseThe user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection. Defaults to
ESSENTIALS
.
- On success, responds with
CreateUserPoolOutput
with field(s):user_pool(Option<UserPoolType>)
:The details of the created user pool.
- On failure, responds with
SdkError<CreateUserPoolError>
Source§impl Client
impl Client
Sourcepub fn create_user_pool_client(&self) -> CreateUserPoolClientFluentBuilder
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: trueThe ID of the user pool where you want to create an app client.
client_name(impl Into<String>)
/set_client_name(Option<String>)
:
required: trueA friendly name for the app client that you want to create.
generate_secret(bool)
/set_generate_secret(Option<bool>)
:
required: falseWhen
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: falseThe refresh token time limit. After this limit expires, your user can’t use their refresh token. To specify the time unit for
RefreshTokenValidity
asseconds
,minutes
,hours
, ordays
, set aTokenValidityUnits
value in your API request.For example, when you set
RefreshTokenValidity
as10
andTokenValidityUnits
asdays
, 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 setRefreshTokenValidity
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: falseThe access token time limit. After this limit expires, your user can’t use their access token. To specify the time unit for
AccessTokenValidity
asseconds
,minutes
,hours
, ordays
, set aTokenValidityUnits
value in your API request.For example, when you set
AccessTokenValidity
to10
andTokenValidityUnits
tohours
, 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: falseThe ID token time limit. After this limit expires, your user can’t use their ID token. To specify the time unit for
IdTokenValidity
asseconds
,minutes
,hours
, ordays
, set aTokenValidityUnits
value in your API request.For example, when you set
IdTokenValidity
as10
andTokenValidityUnits
ashours
, 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: falseThe 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: falseThe 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 ofemail_verified
,phone_number_verified
, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes,ReadAttributes
doesn’t return any information. Amazon Cognito only populatesReadAttributes
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: falseThe 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 populatesWriteAttributes
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: falseThe authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions.
If you don’t specify a value for
ExplicitAuthFlows
, your app client supportsALLOW_REFRESH_TOKEN_AUTH
,ALLOW_USER_SRP_AUTH
, andALLOW_CUSTOM_AUTH
.The values for authentication flow options include the following.
-
ALLOW_USER_AUTH
: Enable selection-based sign-in withUSER_AUTH
. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without otherExplicitAuthFlows
permitting them. For example users can complete an SRP challenge throughUSER_AUTH
without the flowUSER_SRP_AUTH
being active for the app client. This flow doesn’t includeCUSTOM_AUTH
.To activate this setting, your user pool must be in the Essentials tier or higher.
-
ALLOW_ADMIN_USER_PASSWORD_AUTH
: Enable admin based user password authentication flowADMIN_USER_PASSWORD_AUTH
. This setting replaces theADMIN_NO_SRP_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
, orUSER_PASSWORD_AUTH
. You can’t assign these legacyExplicitAuthFlows
values to user pool clients at the same time as values that begin withALLOW_
, likeALLOW_USER_SRP_AUTH
.-
supported_identity_providers(impl Into<String>)
/set_supported_identity_providers(Option<Vec::<String>>)
:
required: falseA list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported:
COGNITO
,Facebook
,Google
,SignInWithApple
, andLoginWithAmazon
. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for exampleMySAMLIdP
orMyOIDCIdP
.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: falseA 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 ofCallbackURLs
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: falseA list of allowed logout URLs for managed login authentication. When you pass
logout_uri
andclient_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 oflogout_uri
. A typical use of these URLs is when a user selects “Sign out” and you redirect them to your public homepage. For more information, see Logout endpoint.default_redirect_uri(impl Into<String>)
/set_default_redirect_uri(Option<String>)
:
required: falseThe default redirect URI. In app clients with one assigned IdP, replaces
redirect_uri
in authentication requests. Must be in theCallbackURLs
list.allowed_o_auth_flows(OAuthFlowType)
/set_allowed_o_auth_flows(Option<Vec::<OAuthFlowType>>)
:
required: falseThe 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
andprofile
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: falseThe 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 includephone
,email
,openid
, andprofile
. Theaws.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: falseSet 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
totrue
in aCreateUserPoolClient
orUpdateUserPoolClient
API request. If you don’t set a value forAllowedOAuthFlowsUserPoolClient
in a request with the CLI or SDKs, it defaults tofalse
. Whenfalse
, only SDK-based API sign-in is permitted.-
analytics_configuration(AnalyticsConfigurationType)
/set_analytics_configuration(Option<AnalyticsConfigurationType>)
:
required: falseThe 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: falseWhen
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 toENABLED
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 toLEGACY
, those APIs return aUserNotFoundException
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: falseActivates 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: falseWhen
true
, your application can include additionalUserContextData
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 activateEnablePropagateAdditionalUserContextData
in an app client that has a client secret.auth_session_validity(i32)
/set_auth_session_validity(Option<i32>)
:
required: falseAmazon 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: falseThe 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):user_pool_client(Option<UserPoolClientType>)
:The details of the new app client.
- On failure, responds with
SdkError<CreateUserPoolClientError>
Source§impl Client
impl Client
Sourcepub fn create_user_pool_domain(&self) -> CreateUserPoolDomainFluentBuilder
pub fn create_user_pool_domain(&self) -> CreateUserPoolDomainFluentBuilder
Constructs a fluent builder for the CreateUserPoolDomain
operation.
- The fluent builder is configurable:
domain(impl Into<String>)
/set_domain(Option<String>)
:
required: trueThe domain string. For custom domains, this is the fully-qualified domain name, such as
auth.example.com
. For prefix domains, this is the prefix alone, such asmyprefix
. A prefix value ofmyprefix
for a user pool in theus-east-1
Region results in a domain ofmyprefix.auth.us-east-1.amazoncognito.com
.user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to add a domain.
managed_login_version(i32)
/set_managed_login_version(Option<i32>)
:
required: falseThe version of managed login branding that you want to apply to your domain. A value of
1
indicates hosted UI (classic) and a version of2
indicates managed login.Managed login requires that your user pool be configured for any feature plan other than
Lite
.custom_domain_config(CustomDomainConfigType)
/set_custom_domain_config(Option<CustomDomainConfigType>)
:
required: falseThe configuration for a custom domain. Configures your domain with an Certificate Manager certificate in the
us-east-1
Region.Provide this parameter only if you want to use a custom domain for your user pool. Otherwise, you can omit this parameter and use a prefix domain instead.
When you create a custom domain, the passkey RP ID defaults to the custom domain. If you had a prefix domain active, this will cause passkey integration for your prefix domain to stop working due to a mismatch in RP ID. To keep the prefix domain passkey integration working, you can explicitly set RP ID to the prefix domain.
- 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 of2
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
impl Client
Sourcepub fn delete_group(&self) -> DeleteGroupFluentBuilder
pub fn delete_group(&self) -> DeleteGroupFluentBuilder
Constructs a fluent builder for the DeleteGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: trueThe name of the group that you want to delete.
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to delete the group.
- On success, responds with
DeleteGroupOutput
- On failure, responds with
SdkError<DeleteGroupError>
Source§impl Client
impl Client
Sourcepub fn delete_identity_provider(&self) -> DeleteIdentityProviderFluentBuilder
pub fn delete_identity_provider(&self) -> DeleteIdentityProviderFluentBuilder
Constructs a fluent builder for the DeleteIdentityProvider
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to delete the identity provider.
provider_name(impl Into<String>)
/set_provider_name(Option<String>)
:
required: trueThe name of the IdP that you want to delete.
- On success, responds with
DeleteIdentityProviderOutput
- On failure, responds with
SdkError<DeleteIdentityProviderError>
Source§impl Client
impl Client
Sourcepub fn delete_managed_login_branding(
&self,
) -> DeleteManagedLoginBrandingFluentBuilder
pub fn delete_managed_login_branding( &self, ) -> DeleteManagedLoginBrandingFluentBuilder
Constructs a fluent builder for the DeleteManagedLoginBranding
operation.
- The fluent builder is configurable:
managed_login_branding_id(impl Into<String>)
/set_managed_login_branding_id(Option<String>)
:
required: trueThe ID of the managed login branding style that you want to delete.
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the managed login branding style that you want to delete.
- On success, responds with
DeleteManagedLoginBrandingOutput
- On failure, responds with
SdkError<DeleteManagedLoginBrandingError>
Source§impl Client
impl Client
Sourcepub fn delete_resource_server(&self) -> DeleteResourceServerFluentBuilder
pub fn delete_resource_server(&self) -> DeleteResourceServerFluentBuilder
Constructs a fluent builder for the DeleteResourceServer
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to delete the resource server.
identifier(impl Into<String>)
/set_identifier(Option<String>)
:
required: trueThe identifier of the resource server that you want to delete.
- On success, responds with
DeleteResourceServerOutput
- On failure, responds with
SdkError<DeleteResourceServerError>
Source§impl Client
impl Client
Sourcepub fn delete_user(&self) -> DeleteUserFluentBuilder
pub fn delete_user(&self) -> DeleteUserFluentBuilder
Constructs a fluent builder for the DeleteUser
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.
- On success, responds with
DeleteUserOutput
- On failure, responds with
SdkError<DeleteUserError>
Source§impl Client
impl Client
Sourcepub fn delete_user_attributes(&self) -> DeleteUserAttributesFluentBuilder
pub fn delete_user_attributes(&self) -> DeleteUserAttributesFluentBuilder
Constructs a fluent builder for the DeleteUserAttributes
operation.
- The fluent builder is configurable:
user_attribute_names(impl Into<String>)
/set_user_attribute_names(Option<Vec::<String>>)
:
required: trueAn array of strings representing the user attribute names you want to delete.
For custom attributes, you must prepend the
custom:
prefix to the attribute name, for examplecustom:department
.access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.
- On success, responds with
DeleteUserAttributesOutput
- On failure, responds with
SdkError<DeleteUserAttributesError>
Source§impl Client
impl Client
Sourcepub fn delete_user_pool(&self) -> DeleteUserPoolFluentBuilder
pub fn delete_user_pool(&self) -> DeleteUserPoolFluentBuilder
Constructs a fluent builder for the DeleteUserPool
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that you want to delete.
- On success, responds with
DeleteUserPoolOutput
- On failure, responds with
SdkError<DeleteUserPoolError>
Source§impl Client
impl Client
Sourcepub fn delete_user_pool_client(&self) -> DeleteUserPoolClientFluentBuilder
pub fn delete_user_pool_client(&self) -> DeleteUserPoolClientFluentBuilder
Constructs a fluent builder for the DeleteUserPoolClient
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to delete the client.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe ID of the user pool app client that you want to delete.
- On success, responds with
DeleteUserPoolClientOutput
- On failure, responds with
SdkError<DeleteUserPoolClientError>
Source§impl Client
impl Client
Sourcepub fn delete_user_pool_domain(&self) -> DeleteUserPoolDomainFluentBuilder
pub fn delete_user_pool_domain(&self) -> DeleteUserPoolDomainFluentBuilder
Constructs a fluent builder for the DeleteUserPoolDomain
operation.
- The fluent builder is configurable:
domain(impl Into<String>)
/set_domain(Option<String>)
:
required: trueThe domain that you want to delete. For custom domains, this is the fully-qualified domain name like
auth.example.com
. For Amazon Cognito prefix domains, this is the prefix alone, likemyprefix
.user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to delete the domain.
- On success, responds with
DeleteUserPoolDomainOutput
- On failure, responds with
SdkError<DeleteUserPoolDomainError>
Source§impl Client
impl Client
Sourcepub fn delete_web_authn_credential(
&self,
) -> DeleteWebAuthnCredentialFluentBuilder
pub fn delete_web_authn_credential( &self, ) -> DeleteWebAuthnCredentialFluentBuilder
Constructs a fluent builder for the DeleteWebAuthnCredential
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.credential_id(impl Into<String>)
/set_credential_id(Option<String>)
:
required: trueThe unique identifier of the passkey that you want to delete.
- On success, responds with
DeleteWebAuthnCredentialOutput
- On failure, responds with
SdkError<DeleteWebAuthnCredentialError>
Source§impl Client
impl Client
Sourcepub fn describe_identity_provider(
&self,
) -> DescribeIdentityProviderFluentBuilder
pub fn describe_identity_provider( &self, ) -> DescribeIdentityProviderFluentBuilder
Constructs a fluent builder for the DescribeIdentityProvider
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that has the IdP that you want to describe..
provider_name(impl Into<String>)
/set_provider_name(Option<String>)
:
required: trueThe name of the IdP that you want to describe.
- On success, responds with
DescribeIdentityProviderOutput
with field(s):identity_provider(Option<IdentityProviderType>)
:The details of the requested IdP.
- On failure, responds with
SdkError<DescribeIdentityProviderError>
Source§impl Client
impl Client
Sourcepub fn describe_managed_login_branding(
&self,
) -> DescribeManagedLoginBrandingFluentBuilder
pub fn describe_managed_login_branding( &self, ) -> DescribeManagedLoginBrandingFluentBuilder
Constructs a fluent builder for the DescribeManagedLoginBranding
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the managed login branding style that you want to get information about.
managed_login_branding_id(impl Into<String>)
/set_managed_login_branding_id(Option<String>)
:
required: trueThe ID of the managed login branding style that you want to get more information about.
return_merged_resources(bool)
/set_return_merged_resources(Option<bool>)
:
required: falseWhen
true
, returns values for branding options that are unchanged from Amazon Cognito defaults. Whenfalse
or when you omit this parameter, returns only values that you customized in your branding style.
- On success, responds with
DescribeManagedLoginBrandingOutput
with field(s):managed_login_branding(Option<ManagedLoginBrandingType>)
:The details of the requested branding style.
- On failure, responds with
SdkError<DescribeManagedLoginBrandingError>
Source§impl Client
impl Client
Sourcepub fn describe_managed_login_branding_by_client(
&self,
) -> DescribeManagedLoginBrandingByClientFluentBuilder
pub fn describe_managed_login_branding_by_client( &self, ) -> DescribeManagedLoginBrandingByClientFluentBuilder
Constructs a fluent builder for the DescribeManagedLoginBrandingByClient
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the app client where you want more information about the managed login branding style.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe app client that’s assigned to the branding style that you want more information about.
return_merged_resources(bool)
/set_return_merged_resources(Option<bool>)
:
required: falseWhen
true
, returns values for branding options that are unchanged from Amazon Cognito defaults. Whenfalse
or when you omit this parameter, returns only values that you customized in your branding style.
- On success, responds with
DescribeManagedLoginBrandingByClientOutput
with field(s):managed_login_branding(Option<ManagedLoginBrandingType>)
:The details of the requested branding style.
- On failure, responds with
SdkError<DescribeManagedLoginBrandingByClientError>
Source§impl Client
impl Client
Sourcepub fn describe_resource_server(&self) -> DescribeResourceServerFluentBuilder
pub fn describe_resource_server(&self) -> DescribeResourceServerFluentBuilder
Constructs a fluent builder for the DescribeResourceServer
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that hosts the resource server.
identifier(impl Into<String>)
/set_identifier(Option<String>)
:
required: trueA unique resource server identifier for the resource server. The identifier can be an API friendly name like
solar-system-data
. You can also set an API URL likehttps://solar-system-data-api.example.com
as your identifier.Amazon Cognito represents scopes in the access token in the format
$resource-server-identifier/$scope
. Longer scope-identifier strings increase the size of your access tokens.
- On success, responds with
DescribeResourceServerOutput
with field(s):resource_server(Option<ResourceServerType>)
:The details of the requested resource server.
- On failure, responds with
SdkError<DescribeResourceServerError>
Source§impl Client
impl Client
Sourcepub fn describe_risk_configuration(
&self,
) -> DescribeRiskConfigurationFluentBuilder
pub fn describe_risk_configuration( &self, ) -> DescribeRiskConfigurationFluentBuilder
Constructs a fluent builder for the DescribeRiskConfiguration
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool with the risk configuration that you want to inspect. You can apply default risk configuration at the user pool level and further customize it from user pool defaults at the app-client level. Specify
ClientId
to inspect client-level configuration, orUserPoolId
to inspect pool-level configuration.client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: falseThe ID of the app client with the risk configuration that you want to inspect. You can apply default risk configuration at the user pool level and further customize it from user pool defaults at the app-client level. Specify
ClientId
to inspect client-level configuration, orUserPoolId
to inspect pool-level configuration.
- On success, responds with
DescribeRiskConfigurationOutput
with field(s):risk_configuration(Option<RiskConfigurationType>)
:The details of the requested risk configuration.
- On failure, responds with
SdkError<DescribeRiskConfigurationError>
Source§impl Client
impl Client
Sourcepub fn describe_user_import_job(&self) -> DescribeUserImportJobFluentBuilder
pub fn describe_user_import_job(&self) -> DescribeUserImportJobFluentBuilder
Constructs a fluent builder for the DescribeUserImportJob
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that’s associated with the import job.
job_id(impl Into<String>)
/set_job_id(Option<String>)
:
required: trueThe Id of the user import job that you want to describe.
- On success, responds with
DescribeUserImportJobOutput
with field(s):user_import_job(Option<UserImportJobType>)
:The details of the user import job. Includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload.
- On failure, responds with
SdkError<DescribeUserImportJobError>
Source§impl Client
impl Client
Sourcepub fn describe_user_pool(&self) -> DescribeUserPoolFluentBuilder
pub fn describe_user_pool(&self) -> DescribeUserPoolFluentBuilder
Constructs a fluent builder for the DescribeUserPool
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool you want to describe.
- On success, responds with
DescribeUserPoolOutput
with field(s):user_pool(Option<UserPoolType>)
:The details of the requested user pool.
- On failure, responds with
SdkError<DescribeUserPoolError>
Source§impl Client
impl Client
Sourcepub fn describe_user_pool_client(&self) -> DescribeUserPoolClientFluentBuilder
pub fn describe_user_pool_client(&self) -> DescribeUserPoolClientFluentBuilder
Constructs a fluent builder for the DescribeUserPoolClient
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the app client you want to describe.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe ID of the app client that you want to describe.
- On success, responds with
DescribeUserPoolClientOutput
with field(s):user_pool_client(Option<UserPoolClientType>)
:The details of the request app client.
- On failure, responds with
SdkError<DescribeUserPoolClientError>
Source§impl Client
impl Client
Sourcepub fn describe_user_pool_domain(&self) -> DescribeUserPoolDomainFluentBuilder
pub fn describe_user_pool_domain(&self) -> DescribeUserPoolDomainFluentBuilder
Constructs a fluent builder for the DescribeUserPoolDomain
operation.
- The fluent builder is configurable:
domain(impl Into<String>)
/set_domain(Option<String>)
:
required: trueThe domain that you want to describe. For custom domains, this is the fully-qualified domain name, such as
auth.example.com
. For Amazon Cognito prefix domains, this is the prefix alone, such asauth
.
- On success, responds with
DescribeUserPoolDomainOutput
with field(s):domain_description(Option<DomainDescriptionType>)
:The details of the requested user pool domain.
- On failure, responds with
SdkError<DescribeUserPoolDomainError>
Source§impl Client
impl Client
Sourcepub fn forget_device(&self) -> ForgetDeviceFluentBuilder
pub fn forget_device(&self) -> ForgetDeviceFluentBuilder
Constructs a fluent builder for the ForgetDevice
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: falseA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.device_key(impl Into<String>)
/set_device_key(Option<String>)
:
required: trueThe unique identifier, or device key, of the device that the user wants to forget.
- On success, responds with
ForgetDeviceOutput
- On failure, responds with
SdkError<ForgetDeviceError>
Source§impl Client
impl Client
Sourcepub fn forgot_password(&self) -> ForgotPasswordFluentBuilder
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: trueThe 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: falseA 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: falseContextual 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: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.analytics_metadata(AnalyticsMetadataType)
/set_analytics_metadata(Option<AnalyticsMetadataType>)
:
required: falseInformation 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: falseA 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 theclientMetadata
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, theClientMetadata
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):code_delivery_details(Option<CodeDeliveryDetailsType>)
:Information about the phone number or email address that Amazon Cognito sent the password-recovery code to.
- On failure, responds with
SdkError<ForgotPasswordError>
Source§impl Client
impl Client
Sourcepub fn get_csv_header(&self) -> GetCSVHeaderFluentBuilder
pub fn get_csv_header(&self) -> GetCSVHeaderFluentBuilder
Constructs a fluent builder for the GetCSVHeader
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that you want to import users into.
- On success, responds with
GetCsvHeaderOutput
with field(s):user_pool_id(Option<String>)
:The ID of the requested user pool.
csv_header(Option<Vec::<String>>)
:A comma-separated list of attributes from your user pool. Save this output to a
.csv
file and populate it with the attributes of the users that you want to import.
- On failure, responds with
SdkError<GetCSVHeaderError>
Source§impl Client
impl Client
Sourcepub fn get_device(&self) -> GetDeviceFluentBuilder
pub fn get_device(&self) -> GetDeviceFluentBuilder
Constructs a fluent builder for the GetDevice
operation.
- The fluent builder is configurable:
device_key(impl Into<String>)
/set_device_key(Option<String>)
:
required: trueThe key of the device that you want to get information about.
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: falseA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.
- On success, responds with
GetDeviceOutput
with field(s):device(Option<DeviceType>)
:Details of the requested device. Includes device information, last-accessed and created dates, and the device key.
- On failure, responds with
SdkError<GetDeviceError>
Source§impl Client
impl Client
Sourcepub fn get_group(&self) -> GetGroupFluentBuilder
pub fn get_group(&self) -> GetGroupFluentBuilder
Constructs a fluent builder for the GetGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: trueThe name of the group that you want to get information about.
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the group that you want to query.
- On success, responds with
GetGroupOutput
with field(s):group(Option<GroupType>)
:A container for the requested group. Includes description, precedence, and IAM role values.
- On failure, responds with
SdkError<GetGroupError>
Source§impl Client
impl Client
Sourcepub fn get_identity_provider_by_identifier(
&self,
) -> GetIdentityProviderByIdentifierFluentBuilder
pub fn get_identity_provider_by_identifier( &self, ) -> GetIdentityProviderByIdentifierFluentBuilder
Constructs a fluent builder for the GetIdentityProviderByIdentifier
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to get information about the IdP.
idp_identifier(impl Into<String>)
/set_idp_identifier(Option<String>)
:
required: trueThe identifier that you assigned to your user pool. The identifier is an alternative name for an IdP that is distinct from the IdP name. For example, an IdP with a name of
MyIdP
might have an identifier of the email domainexample.com
.
- On success, responds with
GetIdentityProviderByIdentifierOutput
with field(s):identity_provider(Option<IdentityProviderType>)
:The configuration of the IdP in your user pool. Includes additional identifiers, the IdP name and type, and trust-relationship details like the issuer URL.
- On failure, responds with
SdkError<GetIdentityProviderByIdentifierError>
Source§impl Client
impl Client
Sourcepub fn get_log_delivery_configuration(
&self,
) -> GetLogDeliveryConfigurationFluentBuilder
pub fn get_log_delivery_configuration( &self, ) -> GetLogDeliveryConfigurationFluentBuilder
Constructs a fluent builder for the GetLogDeliveryConfiguration
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that has the logging configuration that you want to view.
- On success, responds with
GetLogDeliveryConfigurationOutput
with field(s):log_delivery_configuration(Option<LogDeliveryConfigurationType>)
:The logging configuration of the requested user pool. Includes types of logs configured and their destinations.
- On failure, responds with
SdkError<GetLogDeliveryConfigurationError>
Source§impl Client
impl Client
Sourcepub fn get_signing_certificate(&self) -> GetSigningCertificateFluentBuilder
pub fn get_signing_certificate(&self) -> GetSigningCertificateFluentBuilder
Constructs a fluent builder for the GetSigningCertificate
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to view the signing certificate.
- On success, responds with
GetSigningCertificateOutput
with field(s):certificate(Option<String>)
:The x.509 certificate that signs SAML 2.0 authentication requests for your user pool.
- On failure, responds with
SdkError<GetSigningCertificateError>
Source§impl Client
impl Client
Sourcepub fn get_tokens_from_refresh_token(
&self,
) -> GetTokensFromRefreshTokenFluentBuilder
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: trueA 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: trueThe 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: falseThe client secret of the requested app client, if the client has a secret.
device_key(impl Into<String>)
/set_device_key(Option<String>)
:
required: falseWhen 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: falseA 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, theClientMetadata
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):authentication_result(Option<AuthenticationResultType>)
:The object that your application receives after authentication. Contains tokens and information for device authentication.
- On failure, responds with
SdkError<GetTokensFromRefreshTokenError>
Source§impl Client
impl Client
Sourcepub fn get_ui_customization(&self) -> GetUICustomizationFluentBuilder
pub fn get_ui_customization(&self) -> GetUICustomizationFluentBuilder
Constructs a fluent builder for the GetUICustomization
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that you want to query for branding settings.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: falseThe ID of the app client that you want to query for branding settings.
- On success, responds with
GetUiCustomizationOutput
with field(s):ui_customization(Option<UiCustomizationType>)
:Information about the classic hosted UI custom CSS and logo-image branding that you applied to the user pool or app client.
- On failure, responds with
SdkError<GetUICustomizationError>
Source§impl Client
impl Client
Sourcepub fn get_user(&self) -> GetUserFluentBuilder
pub fn get_user(&self) -> GetUserFluentBuilder
Constructs a fluent builder for the GetUser
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.
- On success, responds with
GetUserOutput
with field(s):username(String)
:The name of the user that you requested.
user_attributes(Vec::<AttributeType>)
:An array of name-value pairs representing user attributes.
Custom attributes are prepended with the
custom:
prefix.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
, andSOFTWARE_TOKEN_MFA
.
- On failure, responds with
SdkError<GetUserError>
Source§impl Client
impl Client
Sourcepub fn get_user_attribute_verification_code(
&self,
) -> GetUserAttributeVerificationCodeFluentBuilder
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: trueA 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: trueThe 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: falseA 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 theclientMetadata
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, theClientMetadata
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):code_delivery_details(Option<CodeDeliveryDetailsType>)
:Information about the delivery destination of the user attribute verification code.
- On failure, responds with
SdkError<GetUserAttributeVerificationCodeError>
Source§impl Client
impl Client
Sourcepub fn get_user_auth_factors(&self) -> GetUserAuthFactorsFluentBuilder
pub fn get_user_auth_factors(&self) -> GetUserAuthFactorsFluentBuilder
Constructs a fluent builder for the GetUserAuthFactors
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.
- On success, responds with
GetUserAuthFactorsOutput
with field(s):username(String)
:The name of the user who is eligible for the authentication factors in the response.
preferred_mfa_setting(Option<String>)
:The challenge method that Amazon Cognito returns to the user in response to sign-in requests. 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
, andSOFTWARE_TOKEN_MFA
.configured_user_auth_factors(Option<Vec::<AuthFactorType>>)
:The authentication types that are available to the user with
USER_AUTH
sign-in, for example[“PASSWORD”, “WEB_AUTHN”]
.
- On failure, responds with
SdkError<GetUserAuthFactorsError>
Source§impl Client
impl Client
Sourcepub fn get_user_pool_mfa_config(&self) -> GetUserPoolMfaConfigFluentBuilder
pub fn get_user_pool_mfa_config(&self) -> GetUserPoolMfaConfigFluentBuilder
Constructs a fluent builder for the GetUserPoolMfaConfig
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to query WebAuthn and MFA configuration.
- On success, responds with
GetUserPoolMfaConfigOutput
with field(s):sms_mfa_configuration(Option<SmsMfaConfigType>)
:Shows user pool configuration for SMS message MFA. Includes the message template and the SMS message sending configuration for Amazon SNS.
software_token_mfa_configuration(Option<SoftwareTokenMfaConfigType>)
:Shows user pool configuration for time-based one-time password (TOTP) MFA. Includes TOTP enabled or disabled state.
email_mfa_configuration(Option<EmailMfaConfigType>)
:Shows configuration for user pool email message MFA and sign-in with one-time passwords (OTPs). Includes the subject and body of the email message template for sign-in and MFA messages. To activate this setting, your user pool must be in the Essentials tier or higher.
mfa_configuration(Option<UserPoolMfaType>)
:Displays the state of multi-factor authentication (MFA) as on, off, or optional. When
ON
, all users must set up MFA before they can sign in. WhenOPTIONAL
, your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, chooseOPTIONAL
.When
MfaConfiguration
isOPTIONAL
, managed login doesn’t automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor.web_authn_configuration(Option<WebAuthnConfigurationType>)
:Shows user pool configuration for sign-in with passkey authenticators like biometric devices and security keys. Passkeys are not eligible MFA factors. They are instead an eligible primary sign-in factor for choice-based authentication, or the
USER_AUTH
flow.
- On failure, responds with
SdkError<GetUserPoolMfaConfigError>
Source§impl Client
impl Client
Sourcepub fn global_sign_out(&self) -> GlobalSignOutFluentBuilder
pub fn global_sign_out(&self) -> GlobalSignOutFluentBuilder
Constructs a fluent builder for the GlobalSignOut
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.
- On success, responds with
GlobalSignOutOutput
- On failure, responds with
SdkError<GlobalSignOutError>
Source§impl Client
impl Client
Sourcepub fn initiate_auth(&self) -> InitiateAuthFluentBuilder
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: trueThe authentication flow that you want to initiate. Each
AuthFlow
has linkedAuthParameters
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 ofAdminInitiateAuth
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: falseThe 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 forPREFERRED_CHALLENGE
, Amazon Cognito responds with theAvailableChallenges
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, includeChallengeName: SRP_A
andSRP_A: (The SRP_A Value)
.
For more information about
SECRET_HASH
, see Computing secret hash values. For information aboutDEVICE_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: falseA 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. TheClientMetadata
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 theClientMetadata
parameter in yourInitiateAuth
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 withoutClientMetadata
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, theClientMetadata
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: trueThe ID of the app client that your user wants to sign in to.
analytics_metadata(AnalyticsMetadataType)
/set_analytics_metadata(Option<AnalyticsMetadataType>)
:
required: falseInformation 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: falseContextual 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: falseThe optional session ID from a
ConfirmSignUp
API request. You can sign in a user directly from the sign-up process with theUSER_AUTH
authentication flow. When you pass the session ID toInitiateAuth
, Amazon Cognito assumes the SMS or email message one-time verification password fromConfirmSignUp
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 withUSER_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 withUSER_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 withUSERNAME
and anANSWER
that matches one of the challenge types in theAvailableChallenges
response parameter. -
SMS_MFA
: Respond with anSMS_MFA_CODE
that your user pool delivered in an SMS message. -
EMAIL_OTP
: Respond with anEMAIL_OTP_CODE
that your user pool delivered in an email message. -
PASSWORD_VERIFIER
: Respond withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withNEW_PASSWORD
and any required attributes that Amazon Cognito returned in therequiredAttributes
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. InAdminRespondToAuthChallenge
orRespondToAuthChallenge
, set a value for any keys that Amazon Cognito returned in therequiredAttributes
parameter, then use theAdminUpdateUserAttributes
orUpdateUserAttributes
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 parametersMFAS_CAN_SETUP
value.To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from
InitiateAuth
orAdminInitiateAuth
as an input toAssociateSoftwareToken
. Then, use the session returned byVerifySoftwareToken
as an input toRespondToAuthChallenge
orAdminRespondToAuthChallenge
with challenge nameMFA_SETUP
to complete sign-in.To set up SMS or email MFA, collect a
phone_number
oremail
attribute for the user. Then restart the authentication flow with anInitiateAuth
orAdminInitiateAuth
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 requireSECRET_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
, andSession
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
impl Client
Sourcepub fn list_devices(&self) -> ListDevicesFluentBuilder
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: trueA 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: falseThe 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: falseThis 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
impl Client
Sourcepub fn list_groups(&self) -> ListGroupsFluentBuilder
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:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to list user groups.
limit(i32)
/set_limit(Option<i32>)
:
required: falseThe 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: falseThis 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
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
impl Client
Sourcepub fn list_identity_providers(&self) -> ListIdentityProvidersFluentBuilder
pub fn list_identity_providers(&self) -> ListIdentityProvidersFluentBuilder
Constructs a fluent builder for the ListIdentityProviders
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: trueThe ID of the user pool where you want to list IdPs.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of IdPs that you want Amazon Cognito to return in the response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThis 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
ListIdentityProvidersOutput
with field(s):providers(Vec::<ProviderDescription>)
:An array of the IdPs in your user pool. For each, the response includes identifiers, the IdP name and type, and trust-relationship details like the issuer URL.
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<ListIdentityProvidersError>
Source§impl Client
impl Client
Sourcepub fn list_resource_servers(&self) -> ListResourceServersFluentBuilder
pub fn list_resource_servers(&self) -> ListResourceServersFluentBuilder
Constructs a fluent builder for the ListResourceServers
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: trueThe ID of the user pool where you want to list resource servers.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of resource servers that you want Amazon Cognito to return in the response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThis 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
ListResourceServersOutput
with field(s):resource_servers(Vec::<ResourceServerType>)
:An array of resource servers and the details of their configuration. For each, the response includes names, identifiers, and custom scopes.
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<ListResourceServersError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the user pool that the tags are assigned to.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap::<String, String>>)
:The tags that are assigned to the user pool.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn list_user_import_jobs(&self) -> ListUserImportJobsFluentBuilder
pub fn list_user_import_jobs(&self) -> ListUserImportJobsFluentBuilder
Constructs a fluent builder for the ListUserImportJobs
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to list import jobs.
max_results(i32)
/set_max_results(Option<i32>)
:
required: trueThe maximum number of import jobs that you want Amazon Cognito to return in the response.
pagination_token(impl Into<String>)
/set_pagination_token(Option<String>)
:
required: falseThis 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
ListUserImportJobsOutput
with field(s):user_import_jobs(Option<Vec::<UserImportJobType>>)
:An array of user import jobs from the requested user pool. For each, the response includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload.
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<ListUserImportJobsError>
Source§impl Client
impl Client
Sourcepub fn list_user_pool_clients(&self) -> ListUserPoolClientsFluentBuilder
pub fn list_user_pool_clients(&self) -> ListUserPoolClientsFluentBuilder
Constructs a fluent builder for the ListUserPoolClients
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: trueThe ID of the user pool where you want to list user pool clients.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of app clients that you want Amazon Cognito to return in the response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThis 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
ListUserPoolClientsOutput
with field(s):user_pool_clients(Option<Vec::<UserPoolClientDescription>>)
:An array of app clients and their details. Includes app client ID and name.
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<ListUserPoolClientsError>
Source§impl Client
impl Client
Sourcepub fn list_user_pools(&self) -> ListUserPoolsFluentBuilder
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: falseThis 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: trueThe 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
impl Client
Sourcepub fn list_users(&self) -> ListUsersFluentBuilder
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: trueThe 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: falseA 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 anAttributesToGet
parameter, Amazon Cognito returns all attributes for each user.Use
AttributesToGet
with required attributes in your user pool, or in conjunction withFilter
. 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 anAttributesToGet
parameter returns results.limit(i32)
/set_limit(Option<i32>)
:
required: falseThe 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: falseThis 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: falseA 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 thelist-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
impl Client
Sourcepub fn list_users_in_group(&self) -> ListUsersInGroupFluentBuilder
pub fn list_users_in_group(&self) -> ListUsersInGroupFluentBuilder
Constructs a fluent builder for the ListUsersInGroup
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: trueThe ID of the user pool where you want to view the membership of the requested group.
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: trueThe name of the group that you want to query for user membership.
limit(i32)
/set_limit(Option<i32>)
:
required: falseThe 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: falseThis 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
ListUsersInGroupOutput
with field(s):users(Option<Vec::<UserType>>)
:An array of users who are members in the group, and their attributes.
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<ListUsersInGroupError>
Source§impl Client
impl Client
Sourcepub fn list_web_authn_credentials(&self) -> ListWebAuthnCredentialsFluentBuilder
pub fn list_web_authn_credentials(&self) -> ListWebAuthnCredentialsFluentBuilder
Constructs a fluent builder for the ListWebAuthnCredentials
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThis 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: falseThe maximum number of the user’s passkey credentials that you want to return.
- On success, responds with
ListWebAuthnCredentialsOutput
with field(s):credentials(Vec::<WebAuthnCredentialDescription>)
:A list of registered passkeys for a user.
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<ListWebAuthnCredentialsError>
Source§impl Client
impl Client
Sourcepub fn resend_confirmation_code(&self) -> ResendConfirmationCodeFluentBuilder
pub fn resend_confirmation_code(&self) -> ResendConfirmationCodeFluentBuilder
Constructs a fluent builder for the ResendConfirmationCode
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe ID of the user pool app client where the user signed up.
secret_hash(impl Into<String>)
/set_secret_hash(Option<String>)
:
required: falseA 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: falseContextual 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: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.analytics_metadata(AnalyticsMetadataType)
/set_analytics_metadata(Option<AnalyticsMetadataType>)
:
required: falseInformation 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: falseA 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 ResendConfirmationCode 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 ResendConfirmationCode request. In your function code in Lambda, you can process theclientMetadata
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, theClientMetadata
parameter serves no purpose. -
Validate the
ClientMetadata
value. -
Encrypt the
ClientMetadata
value. Don’t send sensitive information in this parameter.
-
- On success, responds with
ResendConfirmationCodeOutput
with field(s):code_delivery_details(Option<CodeDeliveryDetailsType>)
:Information about the phone number or email address that Amazon Cognito sent the confirmation code to.
- On failure, responds with
SdkError<ResendConfirmationCodeError>
Source§impl Client
impl Client
Sourcepub fn respond_to_auth_challenge(&self) -> RespondToAuthChallengeFluentBuilder
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: trueThe ID of the app client where the user is signing in.
challenge_name(ChallengeNameType)
/set_challenge_name(Option<ChallengeNameType>)
:
required: trueThe 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 withUSER_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 withUSER_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 withUSERNAME
and anANSWER
that matches one of the challenge types in theAvailableChallenges
response parameter. -
SMS_MFA
: Respond with anSMS_MFA_CODE
that your user pool delivered in an SMS message. -
EMAIL_OTP
: Respond with anEMAIL_OTP_CODE
that your user pool delivered in an email message. -
PASSWORD_VERIFIER
: Respond withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withNEW_PASSWORD
and any required attributes that Amazon Cognito returned in therequiredAttributes
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. InAdminRespondToAuthChallenge
orRespondToAuthChallenge
, set a value for any keys that Amazon Cognito returned in therequiredAttributes
parameter, then use theAdminUpdateUserAttributes
orUpdateUserAttributes
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 parametersMFAS_CAN_SETUP
value.To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from
InitiateAuth
orAdminInitiateAuth
as an input toAssociateSoftwareToken
. Then, use the session returned byVerifySoftwareToken
as an input toRespondToAuthChallenge
orAdminRespondToAuthChallenge
with challenge nameMFA_SETUP
to complete sign-in.To set up SMS or email MFA, collect a
phone_number
oremail
attribute for the user. Then restart the authentication flow with anInitiateAuth
orAdminInitiateAuth
request.
-
session(impl Into<String>)
/set_session(Option<String>)
:
required: falseThe session identifier that maintains the state of authentication requests and challenge responses. If an
AdminInitiateAuth
orAdminRespondToAuthChallenge
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 nextAdminRespondToAuthChallenge
request.challenge_responses(impl Into<String>, impl Into<String>)
/set_challenge_responses(Option<HashMap::<String, String>>)
:
required: falseThe 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
, andWEB_AUTHN
.Complete authentication in the
SELECT_CHALLENGE
response forPASSWORD
,PASSWORD_SRP
, andWEB_AUTHN
:-
“ChallengeName”: “SELECT_CHALLENGE”, “ChallengeResponses”: { “ANSWER”: “WEB_AUTHN”, “USERNAME”: “[username]”, “CREDENTIAL”: “[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
andEMAIL_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 anrequiredAttributes
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. InAdminRespondToAuthChallenge
orRespondToAuthChallenge
, set a value for any keys that Amazon Cognito returned in therequiredAttributes
parameter, then use theAdminUpdateUserAttributes
orUpdateUserAttributes
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 aboutDEVICE_KEY
, see Working with user devices in your user pool.analytics_metadata(AnalyticsMetadataType)
/set_analytics_metadata(Option<AnalyticsMetadataType>)
:
required: falseInformation 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: falseContextual 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: falseA 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 theclientMetadata
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, theClientMetadata
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 withUSER_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 withUSER_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 withUSERNAME
and anANSWER
that matches one of the challenge types in theAvailableChallenges
response parameter. -
SMS_MFA
: Respond with anSMS_MFA_CODE
that your user pool delivered in an SMS message. -
EMAIL_OTP
: Respond with anEMAIL_OTP_CODE
that your user pool delivered in an email message. -
PASSWORD_VERIFIER
: Respond withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 withNEW_PASSWORD
and any required attributes that Amazon Cognito returned in therequiredAttributes
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. InAdminRespondToAuthChallenge
orRespondToAuthChallenge
, set a value for any keys that Amazon Cognito returned in therequiredAttributes
parameter, then use theAdminUpdateUserAttributes
orUpdateUserAttributes
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 parametersMFAS_CAN_SETUP
value.To set up time-based one-time password (TOTP) MFA, use the session returned in this challenge from
InitiateAuth
orAdminInitiateAuth
as an input toAssociateSoftwareToken
. Then, use the session returned byVerifySoftwareToken
as an input toRespondToAuthChallenge
orAdminRespondToAuthChallenge
with challenge nameMFA_SETUP
to complete sign-in.To set up SMS or email MFA, collect a
phone_number
oremail
attribute for the user. Then restart the authentication flow with anInitiateAuth
orAdminInitiateAuth
request.
-
session(Option<String>)
:The session identifier that maintains the state of authentication requests and challenge responses. If an
InitiateAuth
orRespondToAuthChallenge
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 nextRespondToAuthChallenge
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
impl Client
Sourcepub fn revoke_token(&self) -> RevokeTokenFluentBuilder
pub fn revoke_token(&self) -> RevokeTokenFluentBuilder
Constructs a fluent builder for the RevokeToken
operation.
- The fluent builder is configurable:
token(impl Into<String>)
/set_token(Option<String>)
:
required: trueThe refresh token that you want to revoke.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe ID of the app client where the token that you want to revoke was issued.
client_secret(impl Into<String>)
/set_client_secret(Option<String>)
:
required: falseThe client secret of the requested app client, if the client has a secret.
- On success, responds with
RevokeTokenOutput
- On failure, responds with
SdkError<RevokeTokenError>
Source§impl Client
impl Client
Sourcepub fn set_log_delivery_configuration(
&self,
) -> SetLogDeliveryConfigurationFluentBuilder
pub fn set_log_delivery_configuration( &self, ) -> SetLogDeliveryConfigurationFluentBuilder
Constructs a fluent builder for the SetLogDeliveryConfiguration
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to configure logging.
log_configurations(LogConfigurationType)
/set_log_configurations(Option<Vec::<LogConfigurationType>>)
:
required: trueA collection of the logging configurations for a user pool.
- On success, responds with
SetLogDeliveryConfigurationOutput
with field(s):log_delivery_configuration(Option<LogDeliveryConfigurationType>)
:The logging configuration that you applied to the requested user pool.
- On failure, responds with
SdkError<SetLogDeliveryConfigurationError>
Source§impl Client
impl Client
Sourcepub fn set_risk_configuration(&self) -> SetRiskConfigurationFluentBuilder
pub fn set_risk_configuration(&self) -> SetRiskConfigurationFluentBuilder
Constructs a fluent builder for the SetRiskConfiguration
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to set a risk configuration. If you include
UserPoolId
in your request, don’t includeClientId
. When the client ID is null, the same risk configuration is applied to all the clients in the userPool. When you include bothClientId
andUserPoolId
, Amazon Cognito maps the configuration to the app client only.client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: falseThe ID of the app client where you want to set a risk configuration. If
ClientId
is null, then the risk configuration is mapped toUserPoolId
. When the client ID is null, the same risk configuration is applied to all the clients in the userPool.When you include a
ClientId
parameter, Amazon Cognito maps the configuration to the app client. When you include bothClientId
andUserPoolId
, Amazon Cognito maps the configuration to the app client only.compromised_credentials_risk_configuration(CompromisedCredentialsRiskConfigurationType)
/set_compromised_credentials_risk_configuration(Option<CompromisedCredentialsRiskConfigurationType>)
:
required: falseThe configuration of automated reactions to detected compromised credentials. Includes settings for blocking future sign-in requests and for the types of password-submission events you want to monitor.
account_takeover_risk_configuration(AccountTakeoverRiskConfigurationType)
/set_account_takeover_risk_configuration(Option<AccountTakeoverRiskConfigurationType>)
:
required: falseThe settings for automated responses and notification templates for adaptive authentication with threat protection.
risk_exception_configuration(RiskExceptionConfigurationType)
/set_risk_exception_configuration(Option<RiskExceptionConfigurationType>)
:
required: falseA set of IP-address overrides to threat protection. You can set up IP-address always-block and always-allow lists.
- On success, responds with
SetRiskConfigurationOutput
with field(s):risk_configuration(Option<RiskConfigurationType>)
:The API response that contains the risk configuration that you set and the timestamp of the most recent change.
- On failure, responds with
SdkError<SetRiskConfigurationError>
Source§impl Client
impl Client
Sourcepub fn set_ui_customization(&self) -> SetUICustomizationFluentBuilder
pub fn set_ui_customization(&self) -> SetUICustomizationFluentBuilder
Constructs a fluent builder for the SetUICustomization
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to apply branding to the classic hosted UI.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: falseThe ID of the app client that you want to customize. To apply a default style to all app clients not configured with client-level branding, set this parameter value to
ALL
.css(impl Into<String>)
/set_css(Option<String>)
:
required: falseA plaintext CSS file that contains the custom fields that you want to apply to your user pool or app client. To download a template, go to the Amazon Cognito console. Navigate to your user pool App clients tab, select Login pages, edit Hosted UI (classic) style, and select the link to
CSS template.css
.image_file(Blob)
/set_image_file(Option<Blob>)
:
required: falseThe image that you want to set as your login in the classic hosted UI, as a Base64-formatted binary object.
- On success, responds with
SetUiCustomizationOutput
with field(s):ui_customization(Option<UiCustomizationType>)
:Information about the hosted UI branding that you applied.
- On failure, responds with
SdkError<SetUICustomizationError>
Source§impl Client
impl Client
Sourcepub fn set_user_mfa_preference(&self) -> SetUserMFAPreferenceFluentBuilder
pub fn set_user_mfa_preference(&self) -> SetUserMFAPreferenceFluentBuilder
Constructs a fluent builder for the SetUserMFAPreference
operation.
- The fluent builder is configurable:
sms_mfa_settings(SmsMfaSettingsType)
/set_sms_mfa_settings(Option<SmsMfaSettingsType>)
:
required: falseUser preferences for SMS message MFA. Activates or deactivates SMS MFA and sets it as the preferred MFA method when multiple methods are available.
software_token_mfa_settings(SoftwareTokenMfaSettingsType)
/set_software_token_mfa_settings(Option<SoftwareTokenMfaSettingsType>)
:
required: falseUser preferences for time-based one-time password (TOTP) MFA. Activates or deactivates TOTP MFA and sets it as the preferred MFA method when multiple methods are available. Users must register a TOTP authenticator before they set this as their preferred MFA method.
email_mfa_settings(EmailMfaSettingsType)
/set_email_mfa_settings(Option<EmailMfaSettingsType>)
:
required: falseUser preferences for email message MFA. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, your user pool must be in the Essentials tier or higher.
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.
- On success, responds with
SetUserMfaPreferenceOutput
- On failure, responds with
SdkError<SetUserMFAPreferenceError>
Source§impl Client
impl Client
Sourcepub fn set_user_pool_mfa_config(&self) -> SetUserPoolMfaConfigFluentBuilder
pub fn set_user_pool_mfa_config(&self) -> SetUserPoolMfaConfigFluentBuilder
Constructs a fluent builder for the SetUserPoolMfaConfig
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe user pool ID.
sms_mfa_configuration(SmsMfaConfigType)
/set_sms_mfa_configuration(Option<SmsMfaConfigType>)
:
required: falseConfigures user pool SMS messages for MFA. Sets the message template and the SMS message sending configuration for Amazon SNS.
software_token_mfa_configuration(SoftwareTokenMfaConfigType)
/set_software_token_mfa_configuration(Option<SoftwareTokenMfaConfigType>)
:
required: falseConfigures a user pool for time-based one-time password (TOTP) MFA. Enables or disables TOTP.
email_mfa_configuration(EmailMfaConfigType)
/set_email_mfa_configuration(Option<EmailMfaConfigType>)
:
required: falseSets configuration for user pool email message MFA and sign-in with one-time passwords (OTPs). Includes the subject and body of the email message template for sign-in and MFA messages. To activate this setting, your user pool must be in the Essentials tier or higher.
mfa_configuration(UserPoolMfaType)
/set_mfa_configuration(Option<UserPoolMfaType>)
:
required: falseSets multi-factor authentication (MFA) to be on, off, or optional. When
ON
, all users must set up MFA before they can sign in. WhenOPTIONAL
, your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, chooseOPTIONAL
.When
MfaConfiguration
isOPTIONAL
, managed login doesn’t automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor.web_authn_configuration(WebAuthnConfigurationType)
/set_web_authn_configuration(Option<WebAuthnConfigurationType>)
:
required: falseThe configuration of your user pool for passkey, or WebAuthn, authentication and registration. You can set this configuration independent of the MFA configuration options in this operation.
- On success, responds with
SetUserPoolMfaConfigOutput
with field(s):sms_mfa_configuration(Option<SmsMfaConfigType>)
:Shows user pool SMS message configuration for MFA and sign-in with SMS-message OTPs. Includes the message template and the SMS message sending configuration for Amazon SNS.
software_token_mfa_configuration(Option<SoftwareTokenMfaConfigType>)
:Shows user pool configuration for time-based one-time password (TOTP) MFA. Includes TOTP enabled or disabled state.
email_mfa_configuration(Option<EmailMfaConfigType>)
:Shows configuration for user pool email message MFA and sign-in with one-time passwords (OTPs). Includes the subject and body of the email message template for sign-in and MFA messages. To activate this setting, your user pool must be in the Essentials tier or higher.
mfa_configuration(Option<UserPoolMfaType>)
:Displays multi-factor authentication (MFA) as on, off, or optional. When
ON
, all users must set up MFA before they can sign in. WhenOPTIONAL
, your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, chooseOPTIONAL
.When
MfaConfiguration
isOPTIONAL
, managed login doesn’t automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor.web_authn_configuration(Option<WebAuthnConfigurationType>)
:The configuration of your user pool for passkey, or WebAuthn, sign-in with authenticators like biometric and security-key devices. Includes relying-party configuration and settings for user-verification requirements.
- On failure, responds with
SdkError<SetUserPoolMfaConfigError>
Source§impl Client
impl Client
Sourcepub fn set_user_settings(&self) -> SetUserSettingsFluentBuilder
pub fn set_user_settings(&self) -> SetUserSettingsFluentBuilder
Constructs a fluent builder for the SetUserSettings
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.mfa_options(MfaOptionType)
/set_mfa_options(Option<Vec::<MfaOptionType>>)
:
required: trueYou can use this parameter only to set an SMS configuration that uses SMS for delivery.
- On success, responds with
SetUserSettingsOutput
- On failure, responds with
SdkError<SetUserSettingsError>
Source§impl Client
impl Client
Sourcepub fn sign_up(&self) -> SignUpFluentBuilder
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: trueThe ID of the app client where the user wants to sign up.
secret_hash(impl Into<String>)
/set_secret_hash(Option<String>)
:
required: falseA 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: trueThe 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: falseThe 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: falseAn array of name-value pairs representing user attributes.
For custom attributes, include a
custom:
prefix in the attribute name, for examplecustom:department
.validation_data(AttributeType)
/set_validation_data(Option<Vec::<AttributeType>>)
:
required: falseTemporary 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: falseInformation 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: falseContextual 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: falseA 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 theclientMetadata
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, theClientMetadata
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 theUSER_AUTH
flow after they complete sign-up.
- On failure, responds with
SdkError<SignUpError>
Source§impl Client
impl Client
Sourcepub fn start_user_import_job(&self) -> StartUserImportJobFluentBuilder
pub fn start_user_import_job(&self) -> StartUserImportJobFluentBuilder
Constructs a fluent builder for the StartUserImportJob
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that you want to start importing users into.
job_id(impl Into<String>)
/set_job_id(Option<String>)
:
required: trueThe ID of a user import job that you previously created.
- On success, responds with
StartUserImportJobOutput
with field(s):user_import_job(Option<UserImportJobType>)
:The details of the user import job. Includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload.
- On failure, responds with
SdkError<StartUserImportJobError>
Source§impl Client
impl Client
Sourcepub fn start_web_authn_registration(
&self,
) -> StartWebAuthnRegistrationFluentBuilder
pub fn start_web_authn_registration( &self, ) -> StartWebAuthnRegistrationFluentBuilder
Constructs a fluent builder for the StartWebAuthnRegistration
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.
- On success, responds with
StartWebAuthnRegistrationOutput
with field(s):credential_creation_options(Document)
:The information that a user can provide in their request to register with their passkey provider.
- On failure, responds with
SdkError<StartWebAuthnRegistrationError>
Source§impl Client
impl Client
Sourcepub fn stop_user_import_job(&self) -> StopUserImportJobFluentBuilder
pub fn stop_user_import_job(&self) -> StopUserImportJobFluentBuilder
Constructs a fluent builder for the StopUserImportJob
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that you want to stop.
job_id(impl Into<String>)
/set_job_id(Option<String>)
:
required: trueThe ID of a running user import job.
- On success, responds with
StopUserImportJobOutput
with field(s):user_import_job(Option<UserImportJobType>)
:The details of the user import job. Includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload.
- On failure, responds with
SdkError<StopUserImportJobError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the user pool to assign the tags to.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueAn array of tag keys and values that you want to assign to the user pool.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the user pool that the tags are assigned to.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueAn array of tag keys that you want to remove from the user pool.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_auth_event_feedback(&self) -> UpdateAuthEventFeedbackFluentBuilder
pub fn update_auth_event_feedback(&self) -> UpdateAuthEventFeedbackFluentBuilder
Constructs a fluent builder for the UpdateAuthEventFeedback
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool where you want to update auth event feedback.
username(impl Into<String>)
/set_username(Option<String>)
:
required: trueThe 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 thesub
of a local user or the username of a user from a third-party IdP.event_id(impl Into<String>)
/set_event_id(Option<String>)
:
required: trueThe ID of the authentication event that you want to submit feedback for.
feedback_token(impl Into<String>)
/set_feedback_token(Option<String>)
:
required: trueThe feedback token, an encrypted object generated by Amazon Cognito and passed to your user in the notification email message from the event.
feedback_value(FeedbackValueType)
/set_feedback_value(Option<FeedbackValueType>)
:
required: trueYour feedback to the authentication event. When you provide a
FeedbackValue
value ofvalid
, you tell Amazon Cognito that you trust a user session where Amazon Cognito has evaluated some level of risk. When you provide aFeedbackValue
value ofinvalid
, you tell Amazon Cognito that you don’t trust a user session, or you don’t believe that Amazon Cognito evaluated a high-enough risk level.
- On success, responds with
UpdateAuthEventFeedbackOutput
- On failure, responds with
SdkError<UpdateAuthEventFeedbackError>
Source§impl Client
impl Client
Sourcepub fn update_device_status(&self) -> UpdateDeviceStatusFluentBuilder
pub fn update_device_status(&self) -> UpdateDeviceStatusFluentBuilder
Constructs a fluent builder for the UpdateDeviceStatus
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.device_key(impl Into<String>)
/set_device_key(Option<String>)
:
required: trueThe device key of the device you want to update, for example
us-west-2_a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
.device_remembered_status(DeviceRememberedStatusType)
/set_device_remembered_status(Option<DeviceRememberedStatusType>)
:
required: falseTo enable device authentication with the specified device, set to
remembered
.To disable, set tonot_remembered
.
- On success, responds with
UpdateDeviceStatusOutput
- On failure, responds with
SdkError<UpdateDeviceStatusError>
Source§impl Client
impl Client
Sourcepub fn update_group(&self) -> UpdateGroupFluentBuilder
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: trueThe name of the group that you want to update.
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the group you want to update.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA new description of the existing group.
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of an IAM role that you want to associate with the group. The role assignment contributes to the
cognito:roles
andcognito:preferred_role
claims in group members’ tokens.precedence(i32)
/set_precedence(Option<i32>)
:
required: falseA 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 nullPrecedence
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 thecognito:roles
andcognito: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 samePrecedence
have the same role ARN, that role is used in thecognito:preferred_role
claim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_role
claim isn’t set in users’ tokens.The default
Precedence
value is null. The maximumPrecedence
value is2^31-1
.
- On success, responds with
UpdateGroupOutput
with field(s):group(Option<GroupType>)
:Contains the updated details of the group, including precedence, IAM role, and description.
- On failure, responds with
SdkError<UpdateGroupError>
Source§impl Client
impl Client
Sourcepub fn update_identity_provider(&self) -> UpdateIdentityProviderFluentBuilder
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: trueThe Id of the user pool where you want to update your IdP.
provider_name(impl Into<String>)
/set_provider_name(Option<String>)
:
required: trueThe 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: falseThe 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” }
-
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” }
-
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: falseA 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: falseAn array of IdP identifiers, for example
“IdPIdentifiers”: [ “MyIdP”, “MyIdP2” ]
. Identifiers are friendly names that you can pass in theidp_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):identity_provider(Option<IdentityProviderType>)
:The identity provider details.
- On failure, responds with
SdkError<UpdateIdentityProviderError>
Source§impl Client
impl Client
Sourcepub fn update_managed_login_branding(
&self,
) -> UpdateManagedLoginBrandingFluentBuilder
pub fn update_managed_login_branding( &self, ) -> UpdateManagedLoginBrandingFluentBuilder
Constructs a fluent builder for the UpdateManagedLoginBranding
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: falseThe ID of the user pool that contains the managed login branding style that you want to update.
managed_login_branding_id(impl Into<String>)
/set_managed_login_branding_id(Option<String>)
:
required: falseThe ID of the managed login branding style that you want to update.
use_cognito_provided_values(bool)
/set_use_cognito_provided_values(Option<bool>)
:
required: falseWhen
true
, applies the default branding style options. This option reverts to default style options that are managed by Amazon Cognito. You can modify them later in the branding designer.When you specify
true
for this option, you must also omit values forSettings
andAssets
in the request.settings(Document)
/set_settings(Option<Document>)
:
required: falseA JSON file, encoded as a
Document
type, with the the settings that you want to apply to your style.assets(AssetType)
/set_assets(Option<Vec::<AssetType>>)
:
required: falseAn array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.
- On success, responds with
UpdateManagedLoginBrandingOutput
with field(s):managed_login_branding(Option<ManagedLoginBrandingType>)
:The details of the branding style that you updated.
- On failure, responds with
SdkError<UpdateManagedLoginBrandingError>
Source§impl Client
impl Client
Sourcepub fn update_resource_server(&self) -> UpdateResourceServerFluentBuilder
pub fn update_resource_server(&self) -> UpdateResourceServerFluentBuilder
Constructs a fluent builder for the UpdateResourceServer
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that contains the resource server that you want to update.
identifier(impl Into<String>)
/set_identifier(Option<String>)
:
required: trueA unique resource server identifier for the resource server. The identifier can be an API friendly name like
solar-system-data
. You can also set an API URL likehttps://solar-system-data-api.example.com
as your identifier.Amazon Cognito represents scopes in the access token in the format
$resource-server-identifier/$scope
. Longer scope-identifier strings increase the size of your access tokens.name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe updated name of the resource server.
scopes(ResourceServerScopeType)
/set_scopes(Option<Vec::<ResourceServerScopeType>>)
:
required: falseAn array of updated custom scope names and descriptions that you want to associate with your resource server.
- On success, responds with
UpdateResourceServerOutput
with field(s):resource_server(Option<ResourceServerType>)
:The updated details of the requested resource server.
- On failure, responds with
SdkError<UpdateResourceServerError>
Source§impl Client
impl Client
Sourcepub fn update_user_attributes(&self) -> UpdateUserAttributesFluentBuilder
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: trueAn 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: trueA 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: falseA 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 theclientMetadata
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, theClientMetadata
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):code_delivery_details_list(Option<Vec::<CodeDeliveryDetailsType>>)
:When the attribute-update request includes an email address or phone number attribute, Amazon Cognito sends a message to users with a code that confirms ownership of the new value that they entered. The
CodeDeliveryDetails
object is information about the delivery destination for that link or code. This behavior happens in user pools configured to automatically verify changes to those attributes. For more information, see Verifying when users change their email or phone number.
- On failure, responds with
SdkError<UpdateUserAttributesError>
Source§impl Client
impl Client
Sourcepub fn update_user_pool(&self) -> UpdateUserPoolFluentBuilder
pub fn update_user_pool(&self) -> UpdateUserPoolFluentBuilder
Constructs a fluent builder for the UpdateUserPool
operation.
- The fluent builder is configurable:
user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool you want to update.
policies(UserPoolPolicyType)
/set_policies(Option<UserPoolPolicyType>)
:
required: falseThe password policy and sign-in policy in the user pool. The password policy sets options like password complexity requirements and password history. The sign-in policy sets the options available to applications in choice-based authentication.
deletion_protection(DeletionProtectionType)
/set_deletion_protection(Option<DeletionProtectionType>)
:
required: falseWhen active,
DeletionProtection
prevents accidental deletion of your user pool. Before you can delete a user pool that you have protected against deletion, you must deactivate this feature.When you try to delete a protected user pool in a
DeleteUserPool
API request, Amazon Cognito returns anInvalidParameterException
error. To delete a protected user pool, send a newDeleteUserPool
request after you deactivate deletion protection in anUpdateUserPool
API request.lambda_config(LambdaConfigType)
/set_lambda_config(Option<LambdaConfigType>)
:
required: falseA collection of user pool Lambda triggers. Amazon Cognito invokes triggers at several possible stages of authentication operations. Triggers can modify the outcome of the operations that invoked them.
auto_verified_attributes(VerifiedAttributeType)
/set_auto_verified_attributes(Option<Vec::<VerifiedAttributeType>>)
:
required: falseThe attributes that you want your user pool to automatically verify. Possible values: email, phone_number. For more information see Verifying contact information at sign-up.
sms_verification_message(impl Into<String>)
/set_sms_verification_message(Option<String>)
:
required: falseThis parameter is no longer used.
email_verification_message(impl Into<String>)
/set_email_verification_message(Option<String>)
:
required: falseThis parameter is no longer used.
email_verification_subject(impl Into<String>)
/set_email_verification_subject(Option<String>)
:
required: falseThis parameter is no longer used.
verification_message_template(VerificationMessageTemplateType)
/set_verification_message_template(Option<VerificationMessageTemplateType>)
:
required: falseThe template for the verification message that your user pool delivers to users who set an email address or phone number attribute.
Set the email message type that corresponds to your
DefaultEmailOption
selection. ForCONFIRM_WITH_LINK
, specify anEmailMessageByLink
and leaveEmailMessage
blank. ForCONFIRM_WITH_CODE
, specify anEmailMessage
and leaveEmailMessageByLink
blank. When you supply both parameters with either choice, Amazon Cognito returns an error.sms_authentication_message(impl Into<String>)
/set_sms_authentication_message(Option<String>)
:
required: falseThe contents of the SMS message that your user pool sends to users in SMS authentication.
user_attribute_update_settings(UserAttributeUpdateSettingsType)
/set_user_attribute_update_settings(Option<UserAttributeUpdateSettingsType>)
:
required: falseThe settings for updates to user attributes. These settings include the property
AttributesRequireVerificationBeforeUpdate
, a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users’ email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers.mfa_configuration(UserPoolMfaType)
/set_mfa_configuration(Option<UserPoolMfaType>)
:
required: falseSets multi-factor authentication (MFA) to be on, off, or optional. When
ON
, all users must set up MFA before they can sign in. WhenOPTIONAL
, your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, chooseOPTIONAL
.When
MfaConfiguration
isOPTIONAL
, managed login doesn’t automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor.device_configuration(DeviceConfigurationType)
/set_device_configuration(Option<DeviceConfigurationType>)
:
required: falseThe device-remembering configuration for a user pool. Device remembering or device tracking is a “Remember me on this device” option for user pools that perform authentication with the device key of a trusted device in the back end, instead of a user-provided MFA code. For more information about device authentication, see Working with user devices in your user pool. A null value indicates that you have deactivated device remembering in your user pool.
When you provide a value for any
DeviceConfiguration
field, you activate the Amazon Cognito device-remembering feature. For more information, see Working with devices.email_configuration(EmailConfigurationType)
/set_email_configuration(Option<EmailConfigurationType>)
:
required: falseThe email configuration of your user pool. The email configuration type sets your preferred sending method, Amazon Web Services Region, and sender for email invitation and verification messages from your user pool.
sms_configuration(SmsConfigurationType)
/set_sms_configuration(Option<SmsConfigurationType>)
:
required: falseThe SMS configuration with the settings for your Amazon Cognito user pool to send SMS message with Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account. For more information see SMS message settings.
user_pool_tags(impl Into<String>, impl Into<String>)
/set_user_pool_tags(Option<HashMap::<String, String>>)
:
required: falseThe tag keys and values to assign to the user pool. A tag is a label that you can use to categorize and manage user pools in different ways, such as by purpose, owner, environment, or other criteria.
admin_create_user_config(AdminCreateUserConfigType)
/set_admin_create_user_config(Option<AdminCreateUserConfigType>)
:
required: falseThe configuration for administrative creation of users. Includes the template for the invitation message for new users, the duration of temporary passwords, and permitting self-service sign-up.
user_pool_add_ons(UserPoolAddOnsType)
/set_user_pool_add_ons(Option<UserPoolAddOnsType>)
:
required: falseContains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to
AUDIT
. To configure automatic security responses to potentially unwanted traffic to your user pool, set toENFORCED
.For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier.
account_recovery_setting(AccountRecoverySettingType)
/set_account_recovery_setting(Option<AccountRecoverySettingType>)
:
required: falseThe available verified method a user can use to recover their password when they call
ForgotPassword
. You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn’t qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred through email.pool_name(impl Into<String>)
/set_pool_name(Option<String>)
:
required: falseThe updated name of your user pool.
user_pool_tier(UserPoolTierType)
/set_user_pool_tier(Option<UserPoolTierType>)
:
required: falseThe user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection. Defaults to
ESSENTIALS
.
- On success, responds with
UpdateUserPoolOutput
- On failure, responds with
SdkError<UpdateUserPoolError>
Source§impl Client
impl Client
Sourcepub fn update_user_pool_client(&self) -> UpdateUserPoolClientFluentBuilder
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: trueThe ID of the user pool where you want to update the app client.
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe ID of the app client that you want to update.
client_name(impl Into<String>)
/set_client_name(Option<String>)
:
required: falseA friendly name for the app client.
refresh_token_validity(i32)
/set_refresh_token_validity(Option<i32>)
:
required: falseThe refresh token time limit. After this limit expires, your user can’t use their refresh token. To specify the time unit for
RefreshTokenValidity
asseconds
,minutes
,hours
, ordays
, set aTokenValidityUnits
value in your API request.For example, when you set
RefreshTokenValidity
as10
andTokenValidityUnits
asdays
, 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 setRefreshTokenValidity
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: falseThe access token time limit. After this limit expires, your user can’t use their access token. To specify the time unit for
AccessTokenValidity
asseconds
,minutes
,hours
, ordays
, set aTokenValidityUnits
value in your API request.For example, when you set
AccessTokenValidity
to10
andTokenValidityUnits
tohours
, 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: falseThe ID token time limit. After this limit expires, your user can’t use their ID token. To specify the time unit for
IdTokenValidity
asseconds
,minutes
,hours
, ordays
, set aTokenValidityUnits
value in your API request.For example, when you set
IdTokenValidity
as10
andTokenValidityUnits
ashours
, 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: falseThe 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: falseThe 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 ofemail_verified
,phone_number_verified
, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes,ReadAttributes
doesn’t return any information. Amazon Cognito only populatesReadAttributes
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: falseThe 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 populatesWriteAttributes
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: falseThe authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions.
If you don’t specify a value for
ExplicitAuthFlows
, your app client supportsALLOW_REFRESH_TOKEN_AUTH
,ALLOW_USER_SRP_AUTH
, andALLOW_CUSTOM_AUTH
.The values for authentication flow options include the following.
-
ALLOW_USER_AUTH
: Enable selection-based sign-in withUSER_AUTH
. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without otherExplicitAuthFlows
permitting them. For example users can complete an SRP challenge throughUSER_AUTH
without the flowUSER_SRP_AUTH
being active for the app client. This flow doesn’t includeCUSTOM_AUTH
.To activate this setting, your user pool must be in the Essentials tier or higher.
-
ALLOW_ADMIN_USER_PASSWORD_AUTH
: Enable admin based user password authentication flowADMIN_USER_PASSWORD_AUTH
. This setting replaces theADMIN_NO_SRP_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
, orUSER_PASSWORD_AUTH
. You can’t assign these legacyExplicitAuthFlows
values to user pool clients at the same time as values that begin withALLOW_
, likeALLOW_USER_SRP_AUTH
.-
supported_identity_providers(impl Into<String>)
/set_supported_identity_providers(Option<Vec::<String>>)
:
required: falseA list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported:
COGNITO
,Facebook
,Google
,SignInWithApple
, andLoginWithAmazon
. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for exampleMySAMLIdP
orMyOIDCIdP
.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: falseA 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 ofCallbackURLs
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: falseA list of allowed logout URLs for managed login authentication. When you pass
logout_uri
andclient_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 oflogout_uri
. A typical use of these URLs is when a user selects “Sign out” and you redirect them to your public homepage. For more information, see Logout endpoint.default_redirect_uri(impl Into<String>)
/set_default_redirect_uri(Option<String>)
:
required: falseThe default redirect URI. In app clients with one assigned IdP, replaces
redirect_uri
in authentication requests. Must be in theCallbackURLs
list.allowed_o_auth_flows(OAuthFlowType)
/set_allowed_o_auth_flows(Option<Vec::<OAuthFlowType>>)
:
required: falseThe 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: falseThe 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 includephone
,email
,openid
, andprofile
. Theaws.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: falseSet 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
totrue
in aCreateUserPoolClient
orUpdateUserPoolClient
API request. If you don’t set a value forAllowedOAuthFlowsUserPoolClient
in a request with the CLI or SDKs, it defaults tofalse
. Whenfalse
, only SDK-based API sign-in is permitted.-
analytics_configuration(AnalyticsConfigurationType)
/set_analytics_configuration(Option<AnalyticsConfigurationType>)
:
required: falseThe 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: falseWhen
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 toENABLED
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 toLEGACY
, those APIs return aUserNotFoundException
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: falseActivates 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: falseWhen
true
, your application can include additionalUserContextData
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 activateEnablePropagateAdditionalUserContextData
in an app client that has a client secret.auth_session_validity(i32)
/set_auth_session_validity(Option<i32>)
:
required: falseAmazon 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: falseThe 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):user_pool_client(Option<UserPoolClientType>)
:The updated details of your app client.
- On failure, responds with
SdkError<UpdateUserPoolClientError>
Source§impl Client
impl Client
Sourcepub fn update_user_pool_domain(&self) -> UpdateUserPoolDomainFluentBuilder
pub fn update_user_pool_domain(&self) -> UpdateUserPoolDomainFluentBuilder
Constructs a fluent builder for the UpdateUserPoolDomain
operation.
- The fluent builder is configurable:
domain(impl Into<String>)
/set_domain(Option<String>)
:
required: trueThe name of the domain that you want to update. For custom domains, this is the fully-qualified domain name, for example
auth.example.com
. For prefix domains, this is the prefix alone, such asmyprefix
.user_pool_id(impl Into<String>)
/set_user_pool_id(Option<String>)
:
required: trueThe ID of the user pool that is associated with the domain you’re updating.
managed_login_version(i32)
/set_managed_login_version(Option<i32>)
:
required: falseA version number that indicates the state of managed login for your domain. Version
1
is hosted UI (classic). Version2
is the newer managed login with the branding designer. For more information, see Managed login.custom_domain_config(CustomDomainConfigType)
/set_custom_domain_config(Option<CustomDomainConfigType>)
:
required: falseThe configuration for a custom domain that hosts managed login for your application. In an
UpdateUserPoolDomain
request, this parameter specifies an SSL certificate for the managed login hosted webserver. The certificate must be an ACM ARN inus-east-1
.When you create a custom domain, the passkey RP ID defaults to the custom domain. If you had a prefix domain active, this will cause passkey integration for your prefix domain to stop working due to a mismatch in RP ID. To keep the prefix domain passkey integration working, you can explicitly set RP ID to the prefix domain.
- 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). Version2
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
impl Client
Sourcepub fn verify_software_token(&self) -> VerifySoftwareTokenFluentBuilder
pub fn verify_software_token(&self) -> VerifySoftwareTokenFluentBuilder
Constructs a fluent builder for the VerifySoftwareToken
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: falseA valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin
.session(impl Into<String>)
/set_session(Option<String>)
:
required: falseThe session ID from an
AssociateSoftwareToken
request.user_code(impl Into<String>)
/set_user_code(Option<String>)
:
required: trueA TOTP that the user generated in their configured authenticator app.
friendly_device_name(impl Into<String>)
/set_friendly_device_name(Option<String>)
:
required: falseA friendly name for the device that’s running the TOTP authenticator.
- On success, responds with
VerifySoftwareTokenOutput
with field(s):status(Option<VerifySoftwareTokenResponseType>)
:Amazon Cognito can accept or reject the code that you provide. This response parameter indicates the success of TOTP verification. Some reasons that this operation might return an error are clock skew on the user’s device and excessive retries.
session(Option<String>)
:This session ID satisfies an
MFA_SETUP
challenge. Supply the session ID in your challenge response.
- On failure, responds with
SdkError<VerifySoftwareTokenError>
Source§impl Client
impl Client
Sourcepub fn verify_user_attribute(&self) -> VerifyUserAttributeFluentBuilder
pub fn verify_user_attribute(&self) -> VerifyUserAttributeFluentBuilder
Constructs a fluent builder for the VerifyUserAttribute
operation.
- The fluent builder is configurable:
access_token(impl Into<String>)
/set_access_token(Option<String>)
:
required: trueA 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: trueThe name of the attribute that you want to verify.
code(impl Into<String>)
/set_code(Option<String>)
:
required: trueThe verification code that your user pool sent to the added or changed attribute, for example the user’s email address.
- On success, responds with
VerifyUserAttributeOutput
- On failure, responds with
SdkError<VerifyUserAttributeError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
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
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
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 thesleep_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 thehttp_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, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
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 bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
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>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
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 rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
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 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.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
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);