@aws-sdk/client-cognito-identity-provider
Version:
AWS SDK for JavaScript Cognito Identity Provider Client for Node.js, Browser and React Native
1,032 lines • 205 kB
TypeScript
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
import { DocumentType as __DocumentType } from "@smithy/types";
import { CognitoIdentityProviderServiceException as __BaseException } from "./CognitoIdentityProviderServiceException";
import { AccountRecoverySettingType, AccountTakeoverRiskConfigurationType, AdminCreateUserConfigType, AnalyticsConfigurationType, AnalyticsMetadataType, AssetType, AttributeType, AuthenticationResultType, AuthFactorType, AuthFlowType, ChallengeNameType, CodeDeliveryDetailsType, CompromisedCredentialsRiskConfigurationType, CustomDomainConfigType, DeletionProtectionType, DeviceConfigurationType, DeviceRememberedStatusType, DeviceType, EmailConfigurationType, EmailMfaSettingsType, ExplicitAuthFlowsType, FeedbackValueType, GroupType, IdentityProviderType, IdentityProviderTypeType, LambdaConfigType, LogConfigurationType, LogDeliveryConfigurationType, ManagedLoginBrandingType, MFAOptionType, OAuthFlowType, PreventUserExistenceErrorTypes, RefreshTokenRotationType, ResourceServerScopeType, ResourceServerType, RiskConfigurationType, RiskExceptionConfigurationType, SmsConfigurationType, SMSMfaSettingsType, SoftwareTokenMfaSettingsType, StatusType, TermsEnforcementType, TermsSourceType, TermsType, TokenValidityUnitsType, UserAttributeUpdateSettingsType, UserContextDataType, UserImportJobType, UserPoolAddOnsType, UserPoolClientType, UserPoolMfaType, UserPoolPolicyType, UserPoolTierType, UserType, VerificationMessageTemplateType, VerifiedAttributeType } from "./models_0";
/**
* @public
*/
export interface GetTokensFromRefreshTokenResponse {
/**
* <p>The object that your application receives after authentication. Contains tokens and
* information for device authentication.</p>
* @public
*/
AuthenticationResult?: AuthenticationResultType | undefined;
}
/**
* <p>This exception is throw when your application requests token refresh with a refresh
* token that has been invalidated by refresh-token rotation.</p>
* @public
*/
export declare class RefreshTokenReuseException extends __BaseException {
readonly name: "RefreshTokenReuseException";
readonly $fault: "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<RefreshTokenReuseException, __BaseException>);
}
/**
* @public
*/
export interface GetUICustomizationRequest {
/**
* <p>The ID of the user pool that you want to query for branding settings.</p>
* @public
*/
UserPoolId: string | undefined;
/**
* <p>The ID of the app client that you want to query for branding settings.</p>
* @public
*/
ClientId?: string | undefined;
}
/**
* <p>A container for the UI customization information for the hosted UI in a user
* pool.</p>
* @public
*/
export interface UICustomizationType {
/**
* <p>The ID of the user pool with hosted UI customizations.</p>
* @public
*/
UserPoolId?: string | undefined;
/**
* <p>The app client ID for your UI customization. When this value isn't present, the
* customization applies to all user pool app clients that don't have client-level
* settings..</p>
* @public
*/
ClientId?: string | undefined;
/**
* <p>A URL path to the hosted logo image of your UI customization.</p>
* @public
*/
ImageUrl?: string | undefined;
/**
* <p>The CSS values in the UI customization.</p>
* @public
*/
CSS?: string | undefined;
/**
* <p>The CSS version number.</p>
* @public
*/
CSSVersion?: string | undefined;
/**
* <p>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 <code>Date</code> object.</p>
* @public
*/
LastModifiedDate?: Date | undefined;
/**
* <p>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 <code>Date</code> object.</p>
* @public
*/
CreationDate?: Date | undefined;
}
/**
* @public
*/
export interface GetUICustomizationResponse {
/**
* <p>Information about the classic hosted UI custom CSS and logo-image branding that you
* applied to the user pool or app client.</p>
* @public
*/
UICustomization: UICustomizationType | undefined;
}
/**
* <p>Represents the request to get information about the user.</p>
* @public
*/
export interface GetUserRequest {
/**
* <p>A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
* <code>aws.cognito.signin.user.admin</code>.</p>
* @public
*/
AccessToken: string | undefined;
}
/**
* <p>Represents the response from the server from the request to get information about the
* user.</p>
* @public
*/
export interface GetUserResponse {
/**
* <p>The name of the user that you requested.</p>
* @public
*/
Username: string | undefined;
/**
* <p>An array of name-value pairs representing user attributes.</p>
* <p>Custom attributes are prepended with the <code>custom:</code> prefix.</p>
* @public
*/
UserAttributes: AttributeType[] | undefined;
/**
* <p>
* <i>This response parameter is no longer supported.</i> 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.</p>
* @public
*/
MFAOptions?: MFAOptionType[] | undefined;
/**
* <p>The user's preferred MFA. Users can prefer SMS message, email message, or TOTP
* MFA.</p>
* @public
*/
PreferredMfaSetting?: string | undefined;
/**
* <p>The MFA options that are activated for the user. The possible values in this list are
* <code>SMS_MFA</code>, <code>EMAIL_OTP</code>, and
* <code>SOFTWARE_TOKEN_MFA</code>.</p>
* @public
*/
UserMFASettingList?: string[] | undefined;
}
/**
* <p>Represents the request to get user attribute verification.</p>
* @public
*/
export interface GetUserAttributeVerificationCodeRequest {
/**
* <p>A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
* <code>aws.cognito.signin.user.admin</code>.</p>
* @public
*/
AccessToken: string | undefined;
/**
* <p>The name of the attribute that the user wants to verify, for example
* <code>email</code>.</p>
* @public
*/
AttributeName: string | undefined;
/**
* <p>A map of custom key-value pairs that you can provide as input for any custom workflows
* that this action triggers.</p>
* <p>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 <i>custom message</i> trigger. When
* Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as
* input. This payload contains a <code>clientMetadata</code> attribute, which provides the
* data that you assigned to the ClientMetadata parameter in your
* GetUserAttributeVerificationCode request. In your function code in Lambda, you can process the <code>clientMetadata</code> value to enhance your workflow for
* your specific needs.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html">
* Using Lambda triggers</a> in the <i>Amazon Cognito Developer Guide</i>.</p>
* <note>
* <p>When you use the <code>ClientMetadata</code> parameter, note that Amazon Cognito won't do the
* following:</p>
* <ul>
* <li>
* <p>Store the <code>ClientMetadata</code> value. This data is available only
* to Lambda triggers that are assigned to a user pool to support custom
* workflows. If your user pool configuration doesn't include triggers, the
* <code>ClientMetadata</code> parameter serves no purpose.</p>
* </li>
* <li>
* <p>Validate the <code>ClientMetadata</code> value.</p>
* </li>
* <li>
* <p>Encrypt the <code>ClientMetadata</code> value. Don't send sensitive
* information in this parameter.</p>
* </li>
* </ul>
* </note>
* @public
*/
ClientMetadata?: Record<string, string> | undefined;
}
/**
* <p>The verification code response returned by the server response to get the user
* attribute verification code.</p>
* @public
*/
export interface GetUserAttributeVerificationCodeResponse {
/**
* <p>Information about the delivery destination of the user attribute verification
* code.</p>
* @public
*/
CodeDeliveryDetails?: CodeDeliveryDetailsType | undefined;
}
/**
* @public
*/
export interface GetUserAuthFactorsRequest {
/**
* <p>A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
* <code>aws.cognito.signin.user.admin</code>.</p>
* @public
*/
AccessToken: string | undefined;
}
/**
* @public
*/
export interface GetUserAuthFactorsResponse {
/**
* <p>The name of the user who is eligible for the authentication factors in the
* response.</p>
* @public
*/
Username: string | undefined;
/**
* <p>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.</p>
* @public
*/
PreferredMfaSetting?: string | undefined;
/**
* <p>The MFA options that are activated for the user. The possible values in this list are
* <code>SMS_MFA</code>, <code>EMAIL_OTP</code>, and
* <code>SOFTWARE_TOKEN_MFA</code>.</p>
* @public
*/
UserMFASettingList?: string[] | undefined;
/**
* <p>The authentication types that are available to the user with <code>USER_AUTH</code>
* sign-in, for example <code>["PASSWORD", "WEB_AUTHN"]</code>.</p>
* @public
*/
ConfiguredUserAuthFactors?: AuthFactorType[] | undefined;
}
/**
* @public
*/
export interface GetUserPoolMfaConfigRequest {
/**
* <p>The ID of the user pool where you want to query WebAuthn and MFA configuration.</p>
* @public
*/
UserPoolId: string | undefined;
}
/**
* <p>Sets or 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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/feature-plans-features-essentials.html">
* Essentials tier</a> or higher.</p>
* @public
*/
export interface EmailMfaConfigType {
/**
* <p>The template for the email messages that your user pool sends to users with codes for
* MFA and sign-in with email OTPs. The message must contain the <code>\{####\}</code>
* placeholder. In the message, Amazon Cognito replaces this placeholder with the code. If you
* don't provide this parameter, Amazon Cognito sends messages in the default format.</p>
* @public
*/
Message?: string | undefined;
/**
* <p>The subject of the email messages that your user pool sends to users with codes for
* MFA and email OTP sign-in.</p>
* @public
*/
Subject?: string | undefined;
}
/**
* <p>The configuration of multi-factor authentication (MFA) with SMS messages in a user
* pool.</p>
* @public
*/
export interface SmsMfaConfigType {
/**
* <p>The SMS authentication message that will be sent to users with the code they must sign
* in with. The message must contain the <code>\{####\}</code> placeholder. Your user pool
* replaces the placeholder with the MFA code. If this parameter isn't provided, your user
* pool sends a default message.</p>
* @public
*/
SmsAuthenticationMessage?: string | undefined;
/**
* <p>User pool configuration for delivery of 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.</p>
* <p>You can set <code>SmsConfiguration</code> in <code>CreateUserPool</code> and <code>
* UpdateUserPool</code>, or in <code>SetUserPoolMfaConfig</code>.</p>
* @public
*/
SmsConfiguration?: SmsConfigurationType | undefined;
}
/**
* <p>Settings for time-based one-time password (TOTP) multi-factor authentication (MFA) in
* a user pool. Enables and disables availability of this feature.</p>
* @public
*/
export interface SoftwareTokenMfaConfigType {
/**
* <p>The activation state of TOTP MFA.</p>
* @public
*/
Enabled?: boolean | undefined;
}
/**
* @public
* @enum
*/
export declare const UserVerificationType: {
readonly PREFERRED: "preferred";
readonly REQUIRED: "required";
};
/**
* @public
*/
export type UserVerificationType = (typeof UserVerificationType)[keyof typeof UserVerificationType];
/**
* <p>Settings for authentication (MFA) with passkey, or webauthN, biometric and
* security-key devices in a user pool. Configures the following:</p>
* <ul>
* <li>
* <p>Configuration for requiring user-verification support in passkeys.</p>
* </li>
* <li>
* <p>The user pool relying-party ID. This is the domain, typically your user pool
* domain, that user's passkey providers should trust as a receiver of passkey
* authentication.</p>
* </li>
* <li>
* <p>The providers that you want to allow as origins for passkey
* authentication.</p>
* </li>
* </ul>
* @public
*/
export interface WebAuthnConfigurationType {
/**
* <p>Sets or displays the authentication domain, typically your user pool domain, that
* passkey providers must use as a relying party (RP) in their configuration.</p>
* <p>Under the following conditions, the passkey relying party ID must be the
* fully-qualified domain name of your custom domain:</p>
* <ul>
* <li>
* <p>The user pool is configured for passkey authentication.</p>
* </li>
* <li>
* <p>The user pool has a custom domain, whether or not it also has a prefix
* domain.</p>
* </li>
* <li>
* <p>Your application performs authentication with managed login or the classic
* hosted UI.</p>
* </li>
* </ul>
* @public
*/
RelyingPartyId?: string | undefined;
/**
* <p>When <code>required</code>, users can only register and sign in users with passkeys
* that are capable of <a href="https://www.w3.org/TR/webauthn-2/#enum-userVerificationRequirement">user
* verification</a>. When <code>preferred</code>, your user pool doesn't
* require the use of authenticators with user verification but encourages it.</p>
* @public
*/
UserVerification?: UserVerificationType | undefined;
}
/**
* @public
*/
export interface GetUserPoolMfaConfigResponse {
/**
* <p>Shows user pool configuration for SMS message MFA. Includes the message template and
* the SMS message sending configuration for Amazon SNS.</p>
* @public
*/
SmsMfaConfiguration?: SmsMfaConfigType | undefined;
/**
* <p>Shows user pool configuration for time-based one-time password (TOTP) MFA. Includes
* TOTP enabled or disabled state.</p>
* @public
*/
SoftwareTokenMfaConfiguration?: SoftwareTokenMfaConfigType | undefined;
/**
* <p>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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/feature-plans-features-essentials.html">
* Essentials tier</a> or higher.</p>
* @public
*/
EmailMfaConfiguration?: EmailMfaConfigType | undefined;
/**
* <p>Displays the state of multi-factor authentication (MFA) as on, off, or optional. When
* <code>ON</code>, all users must set up MFA before they can sign in. When
* <code>OPTIONAL</code>, 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, choose <code>OPTIONAL</code>.</p>
* <p>When <code>MfaConfiguration</code> is <code>OPTIONAL</code>, 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.</p>
* @public
*/
MfaConfiguration?: UserPoolMfaType | undefined;
/**
* <p>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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flows-selection-sdk.html#authentication-flows-selection-choice">choice-based authentication</a>, or the
* <code>USER_AUTH</code> flow.</p>
* @public
*/
WebAuthnConfiguration?: WebAuthnConfigurationType | undefined;
}
/**
* <p>Represents the request to sign out all devices.</p>
* @public
*/
export interface GlobalSignOutRequest {
/**
* <p>A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
* <code>aws.cognito.signin.user.admin</code>.</p>
* @public
*/
AccessToken: string | undefined;
}
/**
* <p>The response to the request to sign out all devices.</p>
* @public
*/
export interface GlobalSignOutResponse {
}
/**
* <p>Initiates the authentication request.</p>
* @public
*/
export interface InitiateAuthRequest {
/**
* <p>The authentication flow that you want to initiate. Each <code>AuthFlow</code> has
* linked <code>AuthParameters</code> that you must submit. The following are some example
* flows.</p>
* <dl>
* <dt>USER_AUTH</dt>
* <dd>
* <p>The entry point for <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flows-selection-sdk.html#authentication-flows-selection-choice">choice-based authentication</a> 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 <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/feature-plans-features-essentials.html">
* Essentials tier</a> or higher.</p>
* </dd>
* <dt>USER_SRP_AUTH</dt>
* <dd>
* <p>Username-password authentication with the Secure Remote Password (SRP)
* protocol. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html#Using-SRP-password-verification-in-custom-authentication-flow">Use SRP password verification in custom
* authentication flow</a>.</p>
* </dd>
* <dt>REFRESH_TOKEN_AUTH and REFRESH_TOKEN</dt>
* <dd>
* <p>Receive new ID and access tokens when you pass a
* <code>REFRESH_TOKEN</code> parameter with a valid refresh token as the
* value. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-the-refresh-token.html">Using the refresh token</a>.</p>
* </dd>
* <dt>CUSTOM_AUTH</dt>
* <dd>
* <p>Custom authentication with Lambda triggers. For more information, see
* <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-challenge.html">Custom authentication challenge Lambda
* triggers</a>.</p>
* </dd>
* <dt>USER_PASSWORD_AUTH</dt>
* <dd>
* <p>Client-side username-password authentication with the password sent
* directly in the request. For more information about client-side and
* server-side authentication, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flows-public-server-side.html">SDK authorization models</a>.</p>
* </dd>
* </dl>
* <p>
* <code>ADMIN_USER_PASSWORD_AUTH</code> is a flow type of <code>AdminInitiateAuth</code>
* and isn't valid for InitiateAuth. <code>ADMIN_NO_SRP_AUTH</code> is a legacy server-side
* username-password flow and isn't valid for InitiateAuth.</p>
* @public
*/
AuthFlow: AuthFlowType | undefined;
/**
* <p>The authentication parameters. These are inputs corresponding to the
* <code>AuthFlow</code> that you're invoking.</p>
* <p>The following are some authentication flows and their parameters. Add a
* <code>SECRET_HASH</code> parameter if your app client has a client secret. Add
* <code>DEVICE_KEY</code> if you want to bypass multi-factor authentication with a
* remembered device. </p>
* <dl>
* <dt>USER_AUTH</dt>
* <dd>
* <ul>
* <li>
* <p>
* <code>USERNAME</code> (required)</p>
* </li>
* <li>
* <p>
* <code>PREFERRED_CHALLENGE</code>. If you don't provide a
* value for <code>PREFERRED_CHALLENGE</code>, Amazon Cognito responds with the
* <code>AvailableChallenges</code> parameter that specifies the
* available sign-in methods.</p>
* </li>
* </ul>
* </dd>
* <dt>USER_SRP_AUTH</dt>
* <dd>
* <ul>
* <li>
* <p>
* <code>USERNAME</code> (required)</p>
* </li>
* <li>
* <p>
* <code>SRP_A</code> (required)</p>
* </li>
* </ul>
* </dd>
* <dt>USER_PASSWORD_AUTH</dt>
* <dd>
* <ul>
* <li>
* <p>
* <code>USERNAME</code> (required)</p>
* </li>
* <li>
* <p>
* <code>PASSWORD</code> (required)</p>
* </li>
* </ul>
* </dd>
* <dt>REFRESH_TOKEN_AUTH/REFRESH_TOKEN</dt>
* <dd>
* <ul>
* <li>
* <p>
* <code>REFRESH_TOKEN</code>(required)</p>
* </li>
* </ul>
* </dd>
* <dt>CUSTOM_AUTH</dt>
* <dd>
* <ul>
* <li>
* <p>
* <code>USERNAME</code> (required)</p>
* </li>
* <li>
* <p>
* <code>ChallengeName: SRP_A</code> (when doing SRP authentication
* before custom challenges)</p>
* </li>
* <li>
* <p>
* <code>SRP_A: (An SRP_A value)</code> (when doing SRP
* authentication before custom challenges)</p>
* </li>
* </ul>
* </dd>
* </dl>
* <p>For more information about <code>SECRET_HASH</code>, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/signing-up-users-in-your-app.html#cognito-user-pools-computing-secret-hash">Computing secret hash values</a>. For information about
* <code>DEVICE_KEY</code>, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-device-tracking.html">Working with user devices in your user pool</a>.</p>
* @public
*/
AuthParameters?: Record<string, string> | undefined;
/**
* <p>A map of custom key-value pairs that you can provide as input for certain custom
* workflows that this action triggers.</p>
* <p>You create custom workflows by assigning Lambda functions to user pool triggers.
* When you send an <code>InitiateAuth</code> request, Amazon Cognito invokes the Lambda functions
* that are specified for various triggers. The <code>ClientMetadata</code> value is passed
* as input to the functions for only the following triggers.</p>
* <ul>
* <li>
* <p>Pre sign-up</p>
* </li>
* <li>
* <p>Pre authentication</p>
* </li>
* <li>
* <p>User migration</p>
* </li>
* </ul>
* <p>When Amazon Cognito invokes the functions for these triggers, it passes a JSON payload as input
* to the function. This payload contains a <code>validationData</code> attribute with the
* data that you assigned to the <code>ClientMetadata</code> parameter in your
* <code>InitiateAuth</code> request. In your function, <code>validationData</code> can
* contribute to operations that require data that isn't in the default
* payload.</p>
* <p>
* <code>InitiateAuth</code> requests invokes the following triggers without
* <code>ClientMetadata</code> as input.</p>
* <ul>
* <li>
* <p>Post authentication</p>
* </li>
* <li>
* <p>Custom message</p>
* </li>
* <li>
* <p>Pre token generation</p>
* </li>
* <li>
* <p>Create auth challenge</p>
* </li>
* <li>
* <p>Define auth challenge</p>
* </li>
* <li>
* <p>Custom email sender</p>
* </li>
* <li>
* <p>Custom SMS sender</p>
* </li>
* </ul>
* <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html">
* Using Lambda triggers</a> in the <i>Amazon Cognito Developer Guide</i>.</p>
* <note>
* <p>When you use the <code>ClientMetadata</code> parameter, note that Amazon Cognito won't do the
* following:</p>
* <ul>
* <li>
* <p>Store the <code>ClientMetadata</code> value. This data is available only
* to Lambda triggers that are assigned to a user pool to support custom
* workflows. If your user pool configuration doesn't include triggers, the
* <code>ClientMetadata</code> parameter serves no purpose.</p>
* </li>
* <li>
* <p>Validate the <code>ClientMetadata</code> value.</p>
* </li>
* <li>
* <p>Encrypt the <code>ClientMetadata</code> value. Don't send sensitive
* information in this parameter.</p>
* </li>
* </ul>
* </note>
* @public
*/
ClientMetadata?: Record<string, string> | undefined;
/**
* <p>The ID of the app client that your user wants to sign in to.</p>
* @public
*/
ClientId: string | undefined;
/**
* <p>Information that supports analytics outcomes with Amazon Pinpoint, including the
* user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier,
* email address, or phone number.</p>
* @public
*/
AnalyticsMetadata?: AnalyticsMetadataType | undefined;
/**
* <p>Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat
* protection evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito
* when it makes API requests.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-viewing-threat-protection-app.html">Collecting data for threat protection in
* applications</a>.</p>
* @public
*/
UserContextData?: UserContextDataType | undefined;
/**
* <p>The optional session ID from a <code>ConfirmSignUp</code> API request. You can sign in
* a user directly from the sign-up process with the <code>USER_AUTH</code> authentication
* flow. When you pass the session ID to <code>InitiateAuth</code>, Amazon Cognito assumes the SMS
* or email message one-time verification password from <code>ConfirmSignUp</code> 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.</p>
* @public
*/
Session?: string | undefined;
}
/**
* <p>Initiates the authentication response.</p>
* @public
*/
export interface InitiateAuthResponse {
/**
* <p>The name of an additional authentication challenge that you must respond to.</p>
* <p>Possible challenges include the following:</p>
* <note>
* <p>All of the following challenges require <code>USERNAME</code> and, when the app
* client has a client secret, <code>SECRET_HASH</code> in the parameters. Include a
* <code>DEVICE_KEY</code> for device authentication.</p>
* </note>
* <ul>
* <li>
* <p>
* <code>WEB_AUTHN</code>: Respond to the challenge with the results of a
* successful authentication with a WebAuthn authenticator, or passkey, as
* <code>CREDENTIAL</code>. Examples of WebAuthn authenticators include
* biometric devices and security keys.</p>
* </li>
* <li>
* <p>
* <code>PASSWORD</code>: Respond with the user's password as <code>PASSWORD</code>.</p>
* </li>
* <li>
* <p>
* <code>PASSWORD_SRP</code>: Respond with the initial SRP secret as <code>SRP_A</code>.</p>
* </li>
* <li>
* <p>
* <code>SELECT_CHALLENGE</code>: Respond with a challenge selection as <code>ANSWER</code>.
* It must be one of the challenge types in the <code>AvailableChallenges</code> response
* parameter. Add the parameters of the selected challenge, for example <code>USERNAME</code>
* and <code>SMS_OTP</code>.</p>
* </li>
* <li>
* <p>
* <code>SMS_MFA</code>: Respond with the code that your user pool delivered in an SMS
* message, as <code>SMS_MFA_CODE</code>
* </p>
* </li>
* <li>
* <p>
* <code>EMAIL_MFA</code>: Respond with the code that your user pool delivered in an email
* message, as <code>EMAIL_MFA_CODE</code>
* </p>
* </li>
* <li>
* <p>
* <code>EMAIL_OTP</code>: Respond with the code that your user pool delivered in an email
* message, as <code>EMAIL_OTP_CODE</code> .</p>
* </li>
* <li>
* <p>
* <code>SMS_OTP</code>: Respond with the code that your user pool delivered in an SMS
* message, as <code>SMS_OTP_CODE</code>.</p>
* </li>
* <li>
* <p>
* <code>PASSWORD_VERIFIER</code>: Respond with the second stage of SRP secrets as
* <code>PASSWORD_CLAIM_SIGNATURE</code>, <code>PASSWORD_CLAIM_SECRET_BLOCK</code>,
* and <code>TIMESTAMP</code>.</p>
* </li>
* <li>
* <p>
* <code>CUSTOM_CHALLENGE</code>: 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
* and issued in the <code>ChallengeParameters</code> of a challenge response.</p>
* </li>
* <li>
* <p>
* <code>DEVICE_SRP_AUTH</code>: Respond with the initial parameters of device SRP
* authentication. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-device-tracking.html#user-pools-remembered-devices-signing-in-with-a-device">Signing in with a device</a>.</p>
* </li>
* <li>
* <p>
* <code>DEVICE_PASSWORD_VERIFIER</code>: Respond with
* <code>PASSWORD_CLAIM_SIGNATURE</code>,
* <code>PASSWORD_CLAIM_SECRET_BLOCK</code>, and <code>TIMESTAMP</code> after
* client-side SRP calculations. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-device-tracking.html#user-pools-remembered-devices-signing-in-with-a-device">Signing in with a device</a>.</p>
* </li>
* <li>
* <p>
* <code>NEW_PASSWORD_REQUIRED</code>: For users who are required to change their
* passwords after successful first login. Respond to this challenge with
* <code>NEW_PASSWORD</code> and any required attributes that Amazon Cognito returned in
* the <code>requiredAttributes</code> parameter. You can also set values for
* attributes that aren't required by your user pool and that your app client
* can write.</p>
* <p>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.</p>
* <note>
* <p>In a <code>NEW_PASSWORD_REQUIRED</code> challenge response, you can't modify a required attribute that already has a value.
* In <code>AdminRespondToAuthChallenge</code> or <code>RespondToAuthChallenge</code>, set a value for any keys that Amazon Cognito returned in the
* <code>requiredAttributes</code> parameter, then use the <code>AdminUpdateUserAttributes</code> or <code>UpdateUserAttributes</code> API
* operation to modify the value of any additional attributes.</p>
* </note>
* </li>
* <li>
* <p>
* <code>MFA_SETUP</code>: For users who are required to setup an MFA factor
* before they can sign in. The MFA types activated for the user pool will be
* listed in the challenge parameters <code>MFAS_CAN_SETUP</code> value. </p>
* <p>To set up time-based one-time password (TOTP) MFA, use the session returned
* in this challenge from <code>InitiateAuth</code> or <code>AdminInitiateAuth</code>
* as an input to <code>AssociateSoftwareToken</code>. Then, use the session returned
* by <code>VerifySoftwareToken</code> as an input to
* <code>RespondToAuthChallenge</code> or <code>AdminRespondToAuthChallenge</code>
* with challenge name <code>MFA_SETUP</code> to complete sign-in.
* </p>
* <p>To set up SMS or email MFA, collect a <code>phone_number</code> or
* <code>email</code> attribute for the user. Then restart the authentication
* flow with an <code>InitiateAuth</code> or <code>AdminInitiateAuth</code> request.
* </p>
* </li>
* </ul>
* @public
*/
ChallengeName?: ChallengeNameType | undefined;
/**
* <p>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.</p>
* @public
*/
Session?: string | undefined;
/**
* <p>The required parameters of the <code>ChallengeName</code> challenge.</p>
* <p>All challenges require <code>USERNAME</code>. They also require
* <code>SECRET_HASH</code> if your app client has a client secret.</p>
* @public
*/
ChallengeParameters?: Record<string, string> | undefined;
/**
* <p>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
* <code>ChallengeName</code>, <code>ChallengeParameters</code>, and
* <code>Session</code> response parameters.</p>
* @public
*/
AuthenticationResult?: AuthenticationResultType | undefined;
/**
* <p>This response parameter lists the available authentication challenges that users can
* select from in <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flows-selection-sdk.html#authentication-flows-selection-choice">choice-based authentication</a>. For example, they might be
* able to choose between passkey authentication, a one-time password from an SMS message,
* and a traditional password.</p>
* @public
*/
AvailableChallenges?: ChallengeNameType[] | undefined;
}
/**
* <p>Represents the request to list the devices.</p>
* @public
*/
export interface ListDevicesRequest {
/**
* <p>A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
* <code>aws.cognito.signin.user.admin</code>.</p>
* @public
*/
AccessToken: string | undefined;
/**
* <p>The maximum number of devices that you want Amazon Cognito to return in the response.</p>
* @public
*/
Limit?: number | undefined;
/**
* <p>This API operation returns a limited number of results. The pagination token is
* an identifier that you can present in an additional API request with the same parameters. When
* you include the pagination token, Amazon Cognito returns the next set of items after the current list.
* Subsequent requests return a new pagination token. By use of this token, you can paginate
* through the full list of items.</p>
* @public
*/
PaginationToken?: string | undefined;
}
/**
* <p>Represents the response to list devices.</p>
* @public
*/
export interface ListDevicesResponse {
/**
* <p>An array of devices and their details. Each entry that's returned includes device
* information, last-accessed and created dates, and the device key.</p>
* @public
*/
Devices?: DeviceType[] | undefined;
/**
* <p>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.</p>
* @public
*/
PaginationToken?: string | undefined;
}
/**
* @public
*/
export interface ListGroupsRequest {
/**
* <p>The ID of the user pool where you want to list user groups.</p>
* @public
*/
UserPoolId: string | undefined;
/**
* <p>The maximum number of groups that you want Amazon Cognito to return in the response.</p>
* @public
*/
Limit?: number | undefined;
/**
* <p>This API operation returns a limited number of results. The pagination token is
* an identifier that you can present in an additional API request with the same parameters. When
* you include the pagination token, Amazon Cognito returns the next set of items after the current list.
* Subsequent requests return a new pagination token. By use of this token, you can paginate
* through the full list of items.</p>
* @public
*/
NextToken?: string | undefined;
}
/**
* @public
*/
export interface ListGroupsResponse {
/**
* <p>An array of groups and their details. Each entry that's returned includes
* description, precedence, and IAM role values.</p>
* @public
*/
Groups?: GroupType[] | undefined;
/**
* <p>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.</p>
* @public
*/
NextToken?: string | undefined;
}
/**
* @public
*/
export interface ListIdentityProvidersRequest {
/**
* <p>The ID of the user pool where you want to list IdPs.</p>
* @public
*/
UserPoolId: string | undefined;
/**
* <p>The maximum number of IdPs that you want Amazon Cognito to return in the response.</p>
* @public
*/
MaxResults?: number | undefined;
/**
* <p>This API operation returns a limited number of results. The pagination token is
* an identifier that you can present in an additional API request with the same parameters. When
* you include the pagination token, Amazon Cognito returns the next set of items after the current list.
* Subsequent requests return a new pagination token. By use of this token, you can paginate
* through the full list of items.</p>
* @public
*/
NextToken?: string | undefined;
}
/**
* <p>The details of a user pool identity provider (IdP), including name and type.</p>
* @public
*/
export interface ProviderDescription {
/**
* <p>The name of the IdP, for example <code>MySAMLProvider</code>.</p>
* @public
*/
ProviderName?: string | undefined;
/**
* <p>The type of the provider, for example <code>SAML</code>. Amazon Cognito supports SAML 2.0,
* OIDC, and social IdPs. User pools list supported social IdPs by name in this response
* parameter: Facebook, Google, Login with Amazon, and Sign in with Apple.</p>
* @public
*/
ProviderType?: IdentityProviderTypeType | undefined;
/**
* <p>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 <code>Date</code> object.</p>
* @public
*/
LastModifiedDate?: Date | undefined;
/**
* <p>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 <code>Date</code> object.</p>
* @public
*/
CreationDate?: Date | undefined;
}
/**
* @public
*/
export interface ListIdentityProvidersResponse {
/**
* <p>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.</p>
* @public
*/
Providers: ProviderDescription[] | undefined;
/**
* <p>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.</p>
* @public
*/
NextToken?: string | undefined;
}
/**
* @public
*/
export interface ListResourceServersRequest {
/**
* <p>The ID of the user pool where you want to list resource servers.</p>
* @public
*/
UserPoolId: string | undefined;
/**
* <p>The maximum number of resource servers that you want Amazon Cognito to return in the
* response.</p>
* @public
*/
MaxResults?: number | undefined;
/**
* <p>This API operation returns a limited number of results. The pagination token is
* an identifier that you can present in an additional API request with the same parameters. When
* you include the pagination token, Amazon Cognito returns the next set of items after the current list.
* Subsequent requests return a new pagination token. By use of this token, you can pagina