You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::CognitoIdentityProvider::Client

Inherits:
Seahorse::Client::Base show all
Includes:
Aws::ClientStubs
Defined in:
gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from Aws::ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



152
153
154
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 152

def initialize(*args)
  super
end

Instance Method Details

#add_custom_attributes(params = {}) ⇒ Struct

Adds additional user attributes to the user pool schema.

Examples:

Request syntax with placeholder values


resp = client.add_custom_attributes({
  user_pool_id: "UserPoolIdType", # required
  custom_attributes: [ # required
    {
      name: "CustomAttributeNameType",
      attribute_data_type: "String", # accepts String, Number, DateTime, Boolean
      developer_only_attribute: false,
      mutable: false,
      required: false,
      number_attribute_constraints: {
        min_value: "StringType",
        max_value: "StringType",
      },
      string_attribute_constraints: {
        min_length: "StringType",
        max_length: "StringType",
      },
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

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

  • :custom_attributes (required, Array<Types::SchemaAttributeType>)

    An array of custom attributes, such as Mutable and Name.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



196
197
198
199
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 196

def add_custom_attributes(params = {}, options = {})
  req = build_request(:add_custom_attributes, params)
  req.send_request(options)
end

#admin_add_user_to_group(params = {}) ⇒ Struct

Adds the specified user to the specified group.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_add_user_to_group({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  group_name: "GroupNameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :username (required, String)

    The username for the user.

  • :group_name (required, String)

    The group name.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



228
229
230
231
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 228

def admin_add_user_to_group(params = {}, options = {})
  req = build_request(:admin_add_user_to_group, params)
  req.send_request(options)
end

#admin_confirm_sign_up(params = {}) ⇒ Struct

Confirms user registration as an admin without using a confirmation code. Works on any user.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for which you want to confirm user registration.

  • :username (required, String)

    The user name for which you want to confirm user registration.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



257
258
259
260
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 257

def (params = {}, options = {})
  req = build_request(:admin_confirm_sign_up, params)
  req.send_request(options)
end

#admin_create_user(params = {}) ⇒ Types::AdminCreateUserResponse

Creates a new user in the specified user pool and sends a welcome message via email or phone (SMS). This message is based on a template that you configured in your call to CreateUserPool or UpdateUserPool. This template includes your custom sign-up instructions and placeholders for user name and temporary password.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_create_user({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  user_attributes: [
    {
      name: "AttributeNameType", # required
      value: "AttributeValueType",
    },
  ],
  validation_data: [
    {
      name: "AttributeNameType", # required
      value: "AttributeValueType",
    },
  ],
  temporary_password: "PasswordType",
  force_alias_creation: false,
  message_action: "RESEND", # accepts RESEND, SUPPRESS
  desired_delivery_mediums: ["SMS"], # accepts SMS, EMAIL
})

Response structure


resp.user.username #=> String
resp.user.attributes #=> Array
resp.user.attributes[0].name #=> String
resp.user.attributes[0].value #=> String
resp.user.user_create_date #=> Time
resp.user.user_last_modified_date #=> Time
resp.user.enabled #=> Boolean
resp.user.user_status #=> String, one of "UNCONFIRMED", "CONFIRMED", "ARCHIVED", "COMPROMISED", "UNKNOWN", "RESET_REQUIRED", "FORCE_CHANGE_PASSWORD"
resp.user.mfa_options #=> Array
resp.user.mfa_options[0].delivery_medium #=> String, one of "SMS", "EMAIL"
resp.user.mfa_options[0].attribute_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where the user will be created.

  • :username (required, String)

    The username for the user. Must be unique within the user pool. Must be a UTF-8 string between 1 and 128 characters. After the user is created, the username cannot be changed.

  • :user_attributes (Array<Types::AttributeType>)

    An array of name-value pairs that contain user attributes and attribute values to be set for the user to be created. You can create a user without specifying any attributes other than Username. However, any attributes that you specify as required (in CreateUserPool or in the Attributes tab of the console) must be supplied either by you (in your call to AdminCreateUser) or by the user (when he or she signs 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. This can be done in your call to AdminCreateUser or in the Users tab of the Amazon Cognito console for managing your user pools.

    In your call to AdminCreateUser, you can set the email_verified attribute to True, and you can set the phone_number_verified attribute to True. (You can also do this by calling AdminUpdateUserAttributes.)

    • email: The email address of the user to whom the message that contains the code and username will be sent. Required if the email_verified attribute is set to True, or if "EMAIL" is specified in the DesiredDeliveryMediums parameter.

    • phone_number: The phone number of the user to whom the message that contains the code and username will be sent. Required if the phone_number_verified attribute is set to True, or if "SMS" is specified in the DesiredDeliveryMediums parameter.

  • :validation_data (Array<Types::AttributeType>)

    The user's validation data. This is an array of name-value pairs that contain user attributes and attribute values that you can use for custom validation, such as restricting the types of user accounts that can be registered. For example, you might choose to allow or disallow user sign-up based on the user's domain.

    To configure custom validation, you must create a Pre Sign-up Lambda trigger for the user pool as described in the Amazon Cognito Developer Guide. The Lambda trigger receives the validation data and uses it in the validation process.

    The user's validation data is not persisted.

  • :temporary_password (String)

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

    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.

    This parameter is not required. If you do not specify a value, Amazon Cognito generates one for you.

    The temporary password can only be used until the user account expiration limit that you specified when you created the user pool. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter.

  • :force_alias_creation (Boolean)

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

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

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

  • :message_action (String)

    Set to "RESEND" to resend the invitation message to a user that already exists and reset the expiration limit on the user's account. Set to "SUPPRESS" to suppress sending the message. Only one value can be specified.

  • :desired_delivery_mediums (Array<String>)

    Specify "EMAIL" if email will be used to send the welcome message. Specify "SMS" if the phone number will be used. The default value is "SMS". More than one value can be specified.

Returns:

See Also:



415
416
417
418
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 415

def admin_create_user(params = {}, options = {})
  req = build_request(:admin_create_user, params)
  req.send_request(options)
end

#admin_delete_user(params = {}) ⇒ Struct

Deletes a user as an administrator. Works on any user.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_delete_user({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to delete the user.

  • :username (required, String)

    The user name of the user you wish to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



443
444
445
446
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 443

def admin_delete_user(params = {}, options = {})
  req = build_request(:admin_delete_user, params)
  req.send_request(options)
end

#admin_delete_user_attributes(params = {}) ⇒ Struct

Deletes the user attributes in a user pool as an administrator. Works on any user.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_delete_user_attributes({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  user_attribute_names: ["AttributeNameType"], # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to delete user attributes.

  • :username (required, String)

    The user name of the user from which you would like to delete attributes.

  • :user_attribute_names (required, Array<String>)

    An array of strings representing the user attribute names you wish to delete.

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



482
483
484
485
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 482

def admin_delete_user_attributes(params = {}, options = {})
  req = build_request(:admin_delete_user_attributes, params)
  req.send_request(options)
end

#admin_disable_provider_for_user(params = {}) ⇒ Struct

Disables the user from signing in with the specified external (SAML or social) identity provider. If the user to disable is a Cognito User Pools native username + password user, they are not permitted to use their password to sign-in. If the user to disable is a linked external IdP user, any link between that user and an existing user is removed. The next time the external user (no longer attached to the previously linked DestinationUser) signs in, they must create a new user account. See AdminLinkProviderForUser.

This action is enabled only for admin access and requires developer credentials.

The ProviderName must match the value specified when creating an IdP for the pool.

To disable a native username + password user, the ProviderName value must be Cognito and the ProviderAttributeName must be Cognito_Subject, with the ProviderAttributeValue being the name that is used in the user pool for the user.

The ProviderAttributeName must always be Cognito_Subject for social identity providers. The ProviderAttributeValue must always be the exact subject that was used when the user was originally linked as a source user.

For de-linking a SAML identity, there are two scenarios. If the linked identity has not yet been used to sign-in, the ProviderAttributeName and ProviderAttributeValue must be the same values that were used for the SourceUser when the identities were originally linked in the AdminLinkProviderForUser call. (If the linking was done with ProviderAttributeName set to Cognito_Subject, the same applies here). However, if the user has already signed in, the ProviderAttributeName must be Cognito_Subject and ProviderAttributeValue must be the subject of the SAML assertion.

Examples:

Request syntax with placeholder values


resp = client.admin_disable_provider_for_user({
  user_pool_id: "StringType", # required
  user: { # required
    provider_name: "ProviderNameType",
    provider_attribute_name: "StringType",
    provider_attribute_value: "StringType",
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

  • (Struct)

    Returns an empty response.

See Also:



547
548
549
550
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 547

def admin_disable_provider_for_user(params = {}, options = {})
  req = build_request(:admin_disable_provider_for_user, params)
  req.send_request(options)
end

#admin_disable_user(params = {}) ⇒ Struct

Disables the specified user as an administrator. Works on any user.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_disable_user({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to disable the user.

  • :username (required, String)

    The user name of the user you wish to disable.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



575
576
577
578
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 575

def admin_disable_user(params = {}, options = {})
  req = build_request(:admin_disable_user, params)
  req.send_request(options)
end

#admin_enable_user(params = {}) ⇒ Struct

Enables the specified user as an administrator. Works on any user.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_enable_user({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to enable the user.

  • :username (required, String)

    The user name of the user you wish to enable.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



603
604
605
606
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 603

def admin_enable_user(params = {}, options = {})
  req = build_request(:admin_enable_user, params)
  req.send_request(options)
end

#admin_forget_device(params = {}) ⇒ Struct

Forgets the device, as an administrator.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_forget_device({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  device_key: "DeviceKeyType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :username (required, String)

    The user name.

  • :device_key (required, String)

    The device key.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



635
636
637
638
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 635

def admin_forget_device(params = {}, options = {})
  req = build_request(:admin_forget_device, params)
  req.send_request(options)
end

#admin_get_device(params = {}) ⇒ Types::AdminGetDeviceResponse

Gets the device, as an administrator.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_get_device({
  device_key: "DeviceKeyType", # required
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
})

Response structure


resp.device.device_key #=> String
resp.device.device_attributes #=> Array
resp.device.device_attributes[0].name #=> String
resp.device.device_attributes[0].value #=> String
resp.device.device_create_date #=> Time
resp.device.device_last_modified_date #=> Time
resp.device.device_last_authenticated_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :device_key (required, String)

    The device key.

  • :user_pool_id (required, String)

    The user pool ID.

  • :username (required, String)

    The user name.

Returns:

See Also:



679
680
681
682
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 679

def admin_get_device(params = {}, options = {})
  req = build_request(:admin_get_device, params)
  req.send_request(options)
end

#admin_get_user(params = {}) ⇒ Types::AdminGetUserResponse

Gets the specified user by user name in a user pool as an administrator. Works on any user.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_get_user({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
})

Response structure


resp.username #=> String
resp.user_attributes #=> Array
resp.user_attributes[0].name #=> String
resp.user_attributes[0].value #=> String
resp.user_create_date #=> Time
resp.user_last_modified_date #=> Time
resp.enabled #=> Boolean
resp.user_status #=> String, one of "UNCONFIRMED", "CONFIRMED", "ARCHIVED", "COMPROMISED", "UNKNOWN", "RESET_REQUIRED", "FORCE_CHANGE_PASSWORD"
resp.mfa_options #=> Array
resp.mfa_options[0].delivery_medium #=> String, one of "SMS", "EMAIL"
resp.mfa_options[0].attribute_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to get information about the user.

  • :username (required, String)

    The user name of the user you wish to retrieve.

Returns:

See Also:



731
732
733
734
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 731

def admin_get_user(params = {}, options = {})
  req = build_request(:admin_get_user, params)
  req.send_request(options)
end

#admin_initiate_auth(params = {}) ⇒ Types::AdminInitiateAuthResponse

Initiates the authentication flow, as an administrator.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_initiate_auth({
  user_pool_id: "UserPoolIdType", # required
  client_id: "ClientIdType", # required
  auth_flow: "USER_SRP_AUTH", # required, accepts USER_SRP_AUTH, REFRESH_TOKEN_AUTH, REFRESH_TOKEN, CUSTOM_AUTH, ADMIN_NO_SRP_AUTH
  auth_parameters: {
    "StringType" => "StringType",
  },
  client_metadata: {
    "StringType" => "StringType",
  },
})

Response structure


resp.challenge_name #=> String, one of "SMS_MFA", "PASSWORD_VERIFIER", "CUSTOM_CHALLENGE", "DEVICE_SRP_AUTH", "DEVICE_PASSWORD_VERIFIER", "ADMIN_NO_SRP_AUTH", "NEW_PASSWORD_REQUIRED"
resp.session #=> String
resp.challenge_parameters #=> Hash
resp.challenge_parameters["StringType"] #=> String
resp.authentication_result.access_token #=> String
resp.authentication_result.expires_in #=> Integer
resp.authentication_result.token_type #=> String
resp.authentication_result.refresh_token #=> String
resp.authentication_result.id_token #=> String
resp.authentication_result..device_key #=> String
resp.authentication_result..device_group_key #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The ID of the Amazon Cognito user pool.

  • :client_id (required, String)

    The app client ID.

  • :auth_flow (required, String)

    The authentication flow for this call to execute. The API action will depend on this value. For example:

    • REFRESH_TOKEN_AUTH will take in a valid refresh token and return new tokens.

    • USER_SRP_AUTH will take in USERNAME and SRP_A and return the SRP variables to be used for next challenge execution.

    Valid values include:

    • USER_SRP_AUTH: Authentication flow for the Secure Remote Password (SRP) protocol.

    • REFRESH_TOKEN_AUTH/REFRESH_TOKEN: Authentication flow for refreshing the access token and ID token by supplying a valid refresh token.

    • CUSTOM_AUTH: Custom authentication flow.

    • ADMIN_NO_SRP_AUTH: Non-SRP authentication flow; you can pass in the USERNAME and PASSWORD directly if the flow is enabled for calling the app client.

  • :auth_parameters (Hash<String,String>)

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

    • 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 REFRESH_TOKEN_AUTH/REFRESH_TOKEN: USERNAME (required), SECRET_HASH (required if the app client is configured with a client secret), REFRESH_TOKEN (required), DEVICE_KEY

    • For ADMIN_NO_SRP_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), PASSWORD (required), DEVICE_KEY

    • For CUSTOM_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY

  • :client_metadata (Hash<String,String>)

    This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda trigger as-is. It can be used to implement additional validations around authentication.

Returns:

See Also:



835
836
837
838
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 835

def admin_initiate_auth(params = {}, options = {})
  req = build_request(:admin_initiate_auth, params)
  req.send_request(options)
end

Links an existing user account in a user pool (DestinationUser) to an identity from an external identity provider (SourceUser) based on a specified attribute name and value from the external identity provider. This allows you to create a link from the existing user account to an external federated user identity that has not yet been used to sign in, so that the federated user identity can be used to sign in as the existing user account.

For example, if there is an existing user with a username and password, this API links that user to a federated user identity, so that when the federated user identity is used, the user signs in as the existing user account.

Because this API allows a user with an external federated identity to sign in as an existing user in the user pool, it is critical that it only be used with external identity providers and provider attributes that have been trusted by the application owner.

See also AdminDisableProviderForUser.

This action is enabled only for admin access and requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_link_provider_for_user({
  user_pool_id: "StringType", # required
  destination_user: { # required
    provider_name: "ProviderNameType",
    provider_attribute_name: "StringType",
    provider_attribute_value: "StringType",
  },
  source_user: { # required
    provider_name: "ProviderNameType",
    provider_attribute_name: "StringType",
    provider_attribute_value: "StringType",
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :destination_user (required, Types::ProviderUserIdentifierType)

    The existing user in the user pool to be linked to the external identity provider user account. Can be a native (Username + Password) Cognito User Pools user or a federated user (for example, a SAML or Facebook user). If the user doesn't exist, an exception is thrown. This is the user that is returned when the new user (with the linked identity provider attribute) signs in.

    The ProviderAttributeValue for the DestinationUser must match the username for the user in the user pool. The ProviderAttributeName will always be ignored.

  • :source_user (required, Types::ProviderUserIdentifierType)

    An external identity provider account for a user who does not currently 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 a federated social identity provider user (Facebook, Google, or Login with Amazon), you must set the ProviderAttributeName to Cognito_Subject. For social identity providers, the ProviderName will be Facebook, Google, or LoginWithAmazon, and Cognito will automatically parse the Facebook, Google, and Login with Amazon tokens for id, sub, and user_id, respectively. The ProviderAttributeValue for the user must be the same value as the id, sub, or user_id value found in the social identity provider token.

    For SAML, the ProviderAttributeName can be any value that matches a claim in the SAML assertion. If you wish to link SAML users based on the subject of the SAML assertion, you should map the subject to a claim through the SAML identity provider and submit that claim name as the ProviderAttributeName. If you set ProviderAttributeName to Cognito_Subject, Cognito will automatically parse the default unique identifier found in the subject from the SAML token.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



926
927
928
929
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 926

def admin_link_provider_for_user(params = {}, options = {})
  req = build_request(:admin_link_provider_for_user, params)
  req.send_request(options)
end

#admin_list_devices(params = {}) ⇒ Types::AdminListDevicesResponse

Lists devices, as an administrator.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_list_devices({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  limit: 1,
  pagination_token: "SearchPaginationTokenType",
})

Response structure


resp.devices #=> Array
resp.devices[0].device_key #=> String
resp.devices[0].device_attributes #=> Array
resp.devices[0].device_attributes[0].name #=> String
resp.devices[0].device_attributes[0].value #=> String
resp.devices[0].device_create_date #=> Time
resp.devices[0].device_last_modified_date #=> Time
resp.devices[0].device_last_authenticated_date #=> Time
resp.pagination_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :username (required, String)

    The user name.

  • :limit (Integer)

    The limit of the devices request.

  • :pagination_token (String)

    The pagination token.

Returns:

See Also:



977
978
979
980
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 977

def admin_list_devices(params = {}, options = {})
  req = build_request(:admin_list_devices, params)
  req.send_request(options)
end

#admin_list_groups_for_user(params = {}) ⇒ Types::AdminListGroupsForUserResponse

Lists the groups that the user belongs to.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_list_groups_for_user({
  username: "UsernameType", # required
  user_pool_id: "UserPoolIdType", # required
  limit: 1,
  next_token: "PaginationKey",
})

Response structure


resp.groups #=> Array
resp.groups[0].group_name #=> String
resp.groups[0].user_pool_id #=> String
resp.groups[0].description #=> String
resp.groups[0].role_arn #=> String
resp.groups[0].precedence #=> Integer
resp.groups[0].last_modified_date #=> Time
resp.groups[0].creation_date #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :username (required, String)

    The username for the user.

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :limit (Integer)

    The limit of the request to list groups.

  • :next_token (String)

    An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

Returns:

See Also:



1030
1031
1032
1033
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1030

def admin_list_groups_for_user(params = {}, options = {})
  req = build_request(:admin_list_groups_for_user, params)
  req.send_request(options)
end

#admin_remove_user_from_group(params = {}) ⇒ Struct

Removes the specified user from the specified group.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_remove_user_from_group({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  group_name: "GroupNameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :username (required, String)

    The username for the user.

  • :group_name (required, String)

    The group name.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1062
1063
1064
1065
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1062

def admin_remove_user_from_group(params = {}, options = {})
  req = build_request(:admin_remove_user_from_group, params)
  req.send_request(options)
end

#admin_reset_user_password(params = {}) ⇒ Struct

Resets the specified user's password in a user pool as an administrator. Works on any user.

When a developer calls this API, the current password is invalidated, so it must be changed. If a user tries to sign in after the API is called, the app will get a PasswordResetRequiredException exception back and should direct the user down the flow to reset the password, which is the same as the forgot password flow. In addition, if the user pool has phone verification selected and a verified phone number exists for the user, or if email verification is selected and a verified email exists for the user, calling this API will also result in sending a message to the end user with the code to change their password.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_reset_user_password({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to reset the user's password.

  • :username (required, String)

    The user name of the user whose password you wish to reset.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1103
1104
1105
1106
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1103

def admin_reset_user_password(params = {}, options = {})
  req = build_request(:admin_reset_user_password, params)
  req.send_request(options)
end

#admin_respond_to_auth_challenge(params = {}) ⇒ Types::AdminRespondToAuthChallengeResponse

Responds to an authentication challenge, as an administrator.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_respond_to_auth_challenge({
  user_pool_id: "UserPoolIdType", # required
  client_id: "ClientIdType", # required
  challenge_name: "SMS_MFA", # required, accepts SMS_MFA, PASSWORD_VERIFIER, CUSTOM_CHALLENGE, DEVICE_SRP_AUTH, DEVICE_PASSWORD_VERIFIER, ADMIN_NO_SRP_AUTH, NEW_PASSWORD_REQUIRED
  challenge_responses: {
    "StringType" => "StringType",
  },
  session: "SessionType",
})

Response structure


resp.challenge_name #=> String, one of "SMS_MFA", "PASSWORD_VERIFIER", "CUSTOM_CHALLENGE", "DEVICE_SRP_AUTH", "DEVICE_PASSWORD_VERIFIER", "ADMIN_NO_SRP_AUTH", "NEW_PASSWORD_REQUIRED"
resp.session #=> String
resp.challenge_parameters #=> Hash
resp.challenge_parameters["StringType"] #=> String
resp.authentication_result.access_token #=> String
resp.authentication_result.expires_in #=> Integer
resp.authentication_result.token_type #=> String
resp.authentication_result.refresh_token #=> String
resp.authentication_result.id_token #=> String
resp.authentication_result..device_key #=> String
resp.authentication_result..device_group_key #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The ID of the Amazon Cognito user pool.

  • :client_id (required, String)

    The app client ID.

  • :challenge_name (required, String)

    The challenge name. For more information, see AdminInitiateAuth.

  • :challenge_responses (Hash<String,String>)

    The challenge responses. These are inputs corresponding to the value of ChallengeName, for example:

    • SMS_MFA: SMS_MFA_CODE, USERNAME, SECRET_HASH (if app client is configured with client secret).

    • PASSWORD_VERIFIER: PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, TIMESTAMP, USERNAME, SECRET_HASH (if app client is configured with client secret).

    • ADMIN_NO_SRP_AUTH: PASSWORD, USERNAME, SECRET_HASH (if app client is configured with client secret).

    • NEW_PASSWORD_REQUIRED: NEW_PASSWORD, any other required attributes, USERNAME, SECRET_HASH (if app client is configured with client secret).

    The value of the USERNAME attribute must be the user's actual username, not an alias (such as email address or phone number). To make this easier, the AdminInitiateAuth response includes the actual username value in the USERNAMEUSER_ID_FOR_SRP attribute, even if you specified an alias in your call to AdminInitiateAuth.

  • :session (String)

    The session which should be passed both ways in challenge-response calls to the service. If InitiateAuth or RespondToAuthChallenge API call determines that the caller needs to go through another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.

Returns:

See Also:



1191
1192
1193
1194
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1191

def admin_respond_to_auth_challenge(params = {}, options = {})
  req = build_request(:admin_respond_to_auth_challenge, params)
  req.send_request(options)
end

#admin_set_user_settings(params = {}) ⇒ Struct

Sets all the user settings for a specified user name. Works on any user.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  mfa_options: [ # required
    {
      delivery_medium: "SMS", # accepts SMS, EMAIL
      attribute_name: "AttributeNameType",
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to set the user's settings, such as MFA options.

  • :username (required, String)

    The user name of the user for whom you wish to set user settings.

  • :mfa_options (required, Array<Types::MFAOptionType>)

    Specifies the options for MFA (e.g., email or phone number).

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1230
1231
1232
1233
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1230

def (params = {}, options = {})
  req = build_request(:admin_set_user_settings, params)
  req.send_request(options)
end

#admin_update_device_status(params = {}) ⇒ Struct

Updates the device status as an administrator.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_update_device_status({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  device_key: "DeviceKeyType", # required
  device_remembered_status: "remembered", # accepts remembered, not_remembered
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :username (required, String)

    The user name.

  • :device_key (required, String)

    The device key.

  • :device_remembered_status (String)

    The status indicating whether a device has been remembered or not.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1266
1267
1268
1269
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1266

def admin_update_device_status(params = {}, options = {})
  req = build_request(:admin_update_device_status, params)
  req.send_request(options)
end

#admin_update_user_attributes(params = {}) ⇒ Struct

Updates the specified user's attributes, including developer attributes, as an administrator. Works on any user.

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

In addition to updating user attributes, this API can also be used to mark phone and email as verified.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_update_user_attributes({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
  user_attributes: [ # required
    {
      name: "AttributeNameType", # required
      value: "AttributeValueType",
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

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

  • :username (required, String)

    The user name of the user for whom you want to update user attributes.

  • :user_attributes (required, Array<Types::AttributeType>)

    An array of name-value pairs representing user attributes.

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1314
1315
1316
1317
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1314

def admin_update_user_attributes(params = {}, options = {})
  req = build_request(:admin_update_user_attributes, params)
  req.send_request(options)
end

#admin_user_global_sign_out(params = {}) ⇒ Struct

Signs out users from all devices, as an administrator.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.admin_user_global_sign_out({
  user_pool_id: "UserPoolIdType", # required
  username: "UsernameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :username (required, String)

    The user name.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1342
1343
1344
1345
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1342

def admin_user_global_sign_out(params = {}, options = {})
  req = build_request(:admin_user_global_sign_out, params)
  req.send_request(options)
end

#change_password(params = {}) ⇒ Struct

Changes the password for a specified user in a user pool.

Examples:

Request syntax with placeholder values


resp = client.change_password({
  previous_password: "PasswordType", # required
  proposed_password: "PasswordType", # required
  access_token: "TokenModelType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :previous_password (required, String)

    The old password in the change password request.

  • :proposed_password (required, String)

    The new password in the change password request.

  • :access_token (required, String)

    The access token in the change password request.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1372
1373
1374
1375
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1372

def change_password(params = {}, options = {})
  req = build_request(:change_password, params)
  req.send_request(options)
end

#confirm_device(params = {}) ⇒ Types::ConfirmDeviceResponse

Confirms tracking of the device. This API call is the call that begins device tracking.

Examples:

Request syntax with placeholder values


resp = client.confirm_device({
  access_token: "TokenModelType", # required
  device_key: "DeviceKeyType", # required
  device_secret_verifier_config: {
    password_verifier: "StringType",
    salt: "StringType",
  },
  device_name: "DeviceNameType",
})

Response structure


resp.user_confirmation_necessary #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    The access token.

  • :device_key (required, String)

    The device key.

  • :device_secret_verifier_config (Types::DeviceSecretVerifierConfigType)

    The configuration of the device secret verifier.

  • :device_name (String)

    The device name.

Returns:

See Also:



1416
1417
1418
1419
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1416

def confirm_device(params = {}, options = {})
  req = build_request(:confirm_device, params)
  req.send_request(options)
end

#confirm_forgot_password(params = {}) ⇒ Struct

Allows a user to enter a confirmation code to reset a forgotten password.

Examples:

Request syntax with placeholder values


resp = client.confirm_forgot_password({
  client_id: "ClientIdType", # required
  secret_hash: "SecretHashType",
  username: "UsernameType", # required
  confirmation_code: "ConfirmationCodeType", # required
  password: "PasswordType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :client_id (required, String)

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

  • :secret_hash (String)

    A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.

  • :username (required, String)

    The user name of the user for whom you want to enter a code to retrieve a forgotten password.

  • :confirmation_code (required, String)

    The confirmation code sent by a user's request to retrieve a forgotten password. For more information, see ForgotPassword

  • :password (required, String)

    The password sent by a user's request to retrieve a forgotten password.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1461
1462
1463
1464
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1461

def confirm_forgot_password(params = {}, options = {})
  req = build_request(:confirm_forgot_password, params)
  req.send_request(options)
end

#confirm_sign_up(params = {}) ⇒ Struct

Confirms registration of a user and handles the existing alias from a previous user.

Examples:

Request syntax with placeholder values


resp = client.({
  client_id: "ClientIdType", # required
  secret_hash: "SecretHashType",
  username: "UsernameType", # required
  confirmation_code: "ConfirmationCodeType", # required
  force_alias_creation: false,
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :client_id (required, String)

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

  • :secret_hash (String)

    A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.

  • :username (required, String)

    The user name of the user whose registration you wish to confirm.

  • :confirmation_code (required, String)

    The confirmation code sent by a user's request to confirm registration.

  • :force_alias_creation (Boolean)

    Boolean to be specified to force user confirmation irrespective of existing alias. By default set to False. If this parameter is set to True and the phone number/email used for sign up confirmation already exists as an alias with a different user, the API call will migrate the alias from the previous user to the newly created user being confirmed. If set to False, the API will throw an AliasExistsException error.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1509
1510
1511
1512
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1509

def (params = {}, options = {})
  req = build_request(:confirm_sign_up, params)
  req.send_request(options)
end

#create_group(params = {}) ⇒ Types::CreateGroupResponse

Creates a new group in the specified user pool.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.create_group({
  group_name: "GroupNameType", # required
  user_pool_id: "UserPoolIdType", # required
  description: "DescriptionType",
  role_arn: "ArnType",
  precedence: 1,
})

Response structure


resp.group.group_name #=> String
resp.group.user_pool_id #=> String
resp.group.description #=> String
resp.group.role_arn #=> String
resp.group.precedence #=> Integer
resp.group.last_modified_date #=> Time
resp.group.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the group. Must be unique.

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :description (String)

    A string containing the description of the group.

  • :role_arn (String)

    The role ARN for the group.

  • :precedence (Integer)

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

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

    The default Precedence value is null.

Returns:

See Also:



1577
1578
1579
1580
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1577

def create_group(params = {}, options = {})
  req = build_request(:create_group, params)
  req.send_request(options)
end

#create_identity_provider(params = {}) ⇒ Types::CreateIdentityProviderResponse

Creates an identity provider for a user pool.

Examples:

Request syntax with placeholder values


resp = client.create_identity_provider({
  user_pool_id: "UserPoolIdType", # required
  provider_name: "ProviderNameTypeV1", # required
  provider_type: "SAML", # required, accepts SAML, Facebook, Google, LoginWithAmazon
  provider_details: { # required
    "StringType" => "StringType",
  },
  attribute_mapping: {
    "AttributeMappingKeyType" => "StringType",
  },
  idp_identifiers: ["IdpIdentifierType"],
})

Response structure


resp.identity_provider.user_pool_id #=> String
resp.identity_provider.provider_name #=> String
resp.identity_provider.provider_type #=> String, one of "SAML", "Facebook", "Google", "LoginWithAmazon"
resp.identity_provider.provider_details #=> Hash
resp.identity_provider.provider_details["StringType"] #=> String
resp.identity_provider.attribute_mapping #=> Hash
resp.identity_provider.attribute_mapping["AttributeMappingKeyType"] #=> String
resp.identity_provider.idp_identifiers #=> Array
resp.identity_provider.idp_identifiers[0] #=> String
resp.identity_provider.last_modified_date #=> Time
resp.identity_provider.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :provider_name (required, String)

    The identity provider name.

  • :provider_type (required, String)

    The identity provider type.

  • :provider_details (required, Hash<String,String>)

    The identity provider details, such as MetadataURL and MetadataFile.

  • :attribute_mapping (Hash<String,String>)

    A mapping of identity provider attributes to standard and custom user pool attributes.

  • :idp_identifiers (Array<String>)

    A list of identity provider identifiers.

Returns:

See Also:



1641
1642
1643
1644
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1641

def create_identity_provider(params = {}, options = {})
  req = build_request(:create_identity_provider, params)
  req.send_request(options)
end

#create_resource_server(params = {}) ⇒ Types::CreateResourceServerResponse

Creates a new OAuth2.0 resource server and defines custom scopes in it.

Examples:

Request syntax with placeholder values


resp = client.create_resource_server({
  user_pool_id: "UserPoolIdType", # required
  identifier: "ResourceServerIdentifierType", # required
  name: "ResourceServerNameType", # required
  scopes: [
    {
      scope_name: "ResourceServerScopeNameType", # required
      scope_description: "ResourceServerScopeDescriptionType", # required
    },
  ],
})

Response structure


resp.resource_server.user_pool_id #=> String
resp.resource_server.identifier #=> String
resp.resource_server.name #=> String
resp.resource_server.scopes #=> Array
resp.resource_server.scopes[0].scope_name #=> String
resp.resource_server.scopes[0].scope_description #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :identifier (required, String)

    A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the resource server is located. For example, https://my-weather-api.example.com.

  • :name (required, String)

    A friendly name for the resource server.

  • :scopes (Array<Types::ResourceServerScopeType>)

    A list of scopes. Each scope is map, where the keys are name and description.

Returns:

See Also:



1695
1696
1697
1698
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1695

def create_resource_server(params = {}, options = {})
  req = build_request(:create_resource_server, params)
  req.send_request(options)
end

#create_user_import_job(params = {}) ⇒ Types::CreateUserImportJobResponse

Creates the user import job.

Examples:

Request syntax with placeholder values


resp = client.create_user_import_job({
  job_name: "UserImportJobNameType", # required
  user_pool_id: "UserPoolIdType", # required
  cloud_watch_logs_role_arn: "ArnType", # required
})

Response structure


resp.user_import_job.job_name #=> String
resp.user_import_job.job_id #=> String
resp.user_import_job.user_pool_id #=> String
resp.user_import_job.pre_signed_url #=> String
resp.user_import_job.creation_date #=> Time
resp.user_import_job.start_date #=> Time
resp.user_import_job.completion_date #=> Time
resp.user_import_job.status #=> String, one of "Created", "Pending", "InProgress", "Stopping", "Expired", "Stopped", "Failed", "Succeeded"
resp.user_import_job.cloud_watch_logs_role_arn #=> String
resp.user_import_job.imported_users #=> Integer
resp.user_import_job.skipped_users #=> Integer
resp.user_import_job.failed_users #=> Integer
resp.user_import_job.completion_message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :job_name (required, String)

    The job name for the user import job.

  • :user_pool_id (required, String)

    The user pool ID for the user pool that the users are being imported into.

  • :cloud_watch_logs_role_arn (required, String)

    The role ARN for the Amazon CloudWatch Logging role for the user import job.

Returns:

See Also:



1745
1746
1747
1748
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1745

def create_user_import_job(params = {}, options = {})
  req = build_request(:create_user_import_job, params)
  req.send_request(options)
end

#create_user_pool(params = {}) ⇒ Types::CreateUserPoolResponse

Creates a new Amazon Cognito user pool and sets the password policy for the pool.

Examples:

Request syntax with placeholder values


resp = client.create_user_pool({
  pool_name: "UserPoolNameType", # required
  policies: {
    password_policy: {
      minimum_length: 1,
      require_uppercase: false,
      require_lowercase: false,
      require_numbers: false,
      require_symbols: false,
    },
  },
  lambda_config: {
    pre_sign_up: "ArnType",
    custom_message: "ArnType",
    post_confirmation: "ArnType",
    pre_authentication: "ArnType",
    post_authentication: "ArnType",
    define_auth_challenge: "ArnType",
    create_auth_challenge: "ArnType",
    verify_auth_challenge_response: "ArnType",
  },
  auto_verified_attributes: ["phone_number"], # accepts phone_number, email
  alias_attributes: ["phone_number"], # accepts phone_number, email, preferred_username
  username_attributes: ["phone_number"], # accepts phone_number, email
  sms_verification_message: "SmsVerificationMessageType",
  email_verification_message: "EmailVerificationMessageType",
  email_verification_subject: "EmailVerificationSubjectType",
  verification_message_template: {
    sms_message: "SmsVerificationMessageType",
    email_message: "EmailVerificationMessageType",
    email_subject: "EmailVerificationSubjectType",
    email_message_by_link: "EmailVerificationMessageByLinkType",
    email_subject_by_link: "EmailVerificationSubjectByLinkType",
    default_email_option: "CONFIRM_WITH_LINK", # accepts CONFIRM_WITH_LINK, CONFIRM_WITH_CODE
  },
  sms_authentication_message: "SmsVerificationMessageType",
  mfa_configuration: "OFF", # accepts OFF, ON, OPTIONAL
  device_configuration: {
    challenge_required_on_new_device: false,
    device_only_remembered_on_user_prompt: false,
  },
  email_configuration: {
    source_arn: "ArnType",
    reply_to_email_address: "EmailAddressType",
  },
  sms_configuration: {
    sns_caller_arn: "ArnType", # required
    external_id: "StringType",
  },
  user_pool_tags: {
    "StringType" => "StringType",
  },
  admin_create_user_config: {
    allow_admin_create_user_only: false,
    unused_account_validity_days: 1,
    invite_message_template: {
      sms_message: "SmsVerificationMessageType",
      email_message: "EmailVerificationMessageType",
      email_subject: "EmailVerificationSubjectType",
    },
  },
  schema: [
    {
      name: "CustomAttributeNameType",
      attribute_data_type: "String", # accepts String, Number, DateTime, Boolean
      developer_only_attribute: false,
      mutable: false,
      required: false,
      number_attribute_constraints: {
        min_value: "StringType",
        max_value: "StringType",
      },
      string_attribute_constraints: {
        min_length: "StringType",
        max_length: "StringType",
      },
    },
  ],
})

Response structure


resp.user_pool.id #=> String
resp.user_pool.name #=> String
resp.user_pool.policies.password_policy.minimum_length #=> Integer
resp.user_pool.policies.password_policy.require_uppercase #=> Boolean
resp.user_pool.policies.password_policy.require_lowercase #=> Boolean
resp.user_pool.policies.password_policy.require_numbers #=> Boolean
resp.user_pool.policies.password_policy.require_symbols #=> Boolean
resp.user_pool.lambda_config. #=> String
resp.user_pool.lambda_config.custom_message #=> String
resp.user_pool.lambda_config.post_confirmation #=> String
resp.user_pool.lambda_config.pre_authentication #=> String
resp.user_pool.lambda_config.post_authentication #=> String
resp.user_pool.lambda_config.define_auth_challenge #=> String
resp.user_pool.lambda_config.create_auth_challenge #=> String
resp.user_pool.lambda_config.verify_auth_challenge_response #=> String
resp.user_pool.status #=> String, one of "Enabled", "Disabled"
resp.user_pool.last_modified_date #=> Time
resp.user_pool.creation_date #=> Time
resp.user_pool.schema_attributes #=> Array
resp.user_pool.schema_attributes[0].name #=> String
resp.user_pool.schema_attributes[0].attribute_data_type #=> String, one of "String", "Number", "DateTime", "Boolean"
resp.user_pool.schema_attributes[0].developer_only_attribute #=> Boolean
resp.user_pool.schema_attributes[0].mutable #=> Boolean
resp.user_pool.schema_attributes[0].required #=> Boolean
resp.user_pool.schema_attributes[0].number_attribute_constraints.min_value #=> String
resp.user_pool.schema_attributes[0].number_attribute_constraints.max_value #=> String
resp.user_pool.schema_attributes[0].string_attribute_constraints.min_length #=> String
resp.user_pool.schema_attributes[0].string_attribute_constraints.max_length #=> String
resp.user_pool.auto_verified_attributes #=> Array
resp.user_pool.auto_verified_attributes[0] #=> String, one of "phone_number", "email"
resp.user_pool.alias_attributes #=> Array
resp.user_pool.alias_attributes[0] #=> String, one of "phone_number", "email", "preferred_username"
resp.user_pool.username_attributes #=> Array
resp.user_pool.username_attributes[0] #=> String, one of "phone_number", "email"
resp.user_pool.sms_verification_message #=> String
resp.user_pool.email_verification_message #=> String
resp.user_pool.email_verification_subject #=> String
resp.user_pool.verification_message_template.sms_message #=> String
resp.user_pool.verification_message_template.email_message #=> String
resp.user_pool.verification_message_template.email_subject #=> String
resp.user_pool.verification_message_template.email_message_by_link #=> String
resp.user_pool.verification_message_template.email_subject_by_link #=> String
resp.user_pool.verification_message_template.default_email_option #=> String, one of "CONFIRM_WITH_LINK", "CONFIRM_WITH_CODE"
resp.user_pool.sms_authentication_message #=> String
resp.user_pool.mfa_configuration #=> String, one of "OFF", "ON", "OPTIONAL"
resp.user_pool.device_configuration.challenge_required_on_new_device #=> Boolean
resp.user_pool.device_configuration.device_only_remembered_on_user_prompt #=> Boolean
resp.user_pool.estimated_number_of_users #=> Integer
resp.user_pool.email_configuration.source_arn #=> String
resp.user_pool.email_configuration.reply_to_email_address #=> String
resp.user_pool.sms_configuration.sns_caller_arn #=> String
resp.user_pool.sms_configuration.external_id #=> String
resp.user_pool.user_pool_tags #=> Hash
resp.user_pool.user_pool_tags["StringType"] #=> String
resp.user_pool.sms_configuration_failure #=> String
resp.user_pool.email_configuration_failure #=> String
resp.user_pool.admin_create_user_config.allow_admin_create_user_only #=> Boolean
resp.user_pool.admin_create_user_config. #=> Integer
resp.user_pool.admin_create_user_config.invite_message_template.sms_message #=> String
resp.user_pool.admin_create_user_config.invite_message_template.email_message #=> String
resp.user_pool.admin_create_user_config.invite_message_template.email_subject #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :pool_name (required, String)

    A string used to name the user pool.

  • :policies (Types::UserPoolPolicyType)

    The policies associated with the new user pool.

  • :lambda_config (Types::LambdaConfigType)

    The Lambda trigger configuration information for the new user pool.

  • :auto_verified_attributes (Array<String>)

    The attributes to be auto-verified. Possible values: email, phone_number.

  • :alias_attributes (Array<String>)

    Attributes supported as an alias for this user pool. Possible values: phone_number, email, or preferred_username.

  • :username_attributes (Array<String>)

    Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.

  • :sms_verification_message (String)

    A string representing the SMS verification message.

  • :email_verification_message (String)

    A string representing the email verification message.

  • :email_verification_subject (String)

    A string representing the email verification subject.

  • :verification_message_template (Types::VerificationMessageTemplateType)

    The template for the verification message that the user sees when the app requests permission to access the user's information.

  • :sms_authentication_message (String)

    A string representing the SMS authentication message.

  • :mfa_configuration (String)

    Specifies MFA configuration details.

  • :device_configuration (Types::DeviceConfigurationType)

    The device configuration.

  • :email_configuration (Types::EmailConfigurationType)

    The email configuration.

  • :sms_configuration (Types::SmsConfigurationType)

    The SMS configuration.

  • :user_pool_tags (Hash<String,String>)

    The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

  • :admin_create_user_config (Types::AdminCreateUserConfigType)

    The configuration for AdminCreateUser requests.

  • :schema (Array<Types::SchemaAttributeType>)

    An array of schema attributes for the new user pool. These attributes can be standard or custom attributes.

Returns:

See Also:



1971
1972
1973
1974
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 1971

def create_user_pool(params = {}, options = {})
  req = build_request(:create_user_pool, params)
  req.send_request(options)
end

#create_user_pool_client(params = {}) ⇒ Types::CreateUserPoolClientResponse

Creates the user pool client.

Examples:

Request syntax with placeholder values


resp = client.create_user_pool_client({
  user_pool_id: "UserPoolIdType", # required
  client_name: "ClientNameType", # required
  generate_secret: false,
  refresh_token_validity: 1,
  read_attributes: ["ClientPermissionType"],
  write_attributes: ["ClientPermissionType"],
  explicit_auth_flows: ["ADMIN_NO_SRP_AUTH"], # accepts ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY
  supported_identity_providers: ["ProviderNameType"],
  callback_urls: ["RedirectUrlType"],
  logout_urls: ["RedirectUrlType"],
  default_redirect_uri: "RedirectUrlType",
  allowed_o_auth_flows: ["code"], # accepts code, implicit, client_credentials
  allowed_o_auth_scopes: ["ScopeType"],
  allowed_o_auth_flows_user_pool_client: false,
})

Response structure


resp.user_pool_client.user_pool_id #=> String
resp.user_pool_client.client_name #=> String
resp.user_pool_client.client_id #=> String
resp.user_pool_client.client_secret #=> String
resp.user_pool_client.last_modified_date #=> Time
resp.user_pool_client.creation_date #=> Time
resp.user_pool_client.refresh_token_validity #=> Integer
resp.user_pool_client.read_attributes #=> Array
resp.user_pool_client.read_attributes[0] #=> String
resp.user_pool_client.write_attributes #=> Array
resp.user_pool_client.write_attributes[0] #=> String
resp.user_pool_client.explicit_auth_flows #=> Array
resp.user_pool_client.explicit_auth_flows[0] #=> String, one of "ADMIN_NO_SRP_AUTH", "CUSTOM_AUTH_FLOW_ONLY"
resp.user_pool_client.supported_identity_providers #=> Array
resp.user_pool_client.supported_identity_providers[0] #=> String
resp.user_pool_client.callback_urls #=> Array
resp.user_pool_client.callback_urls[0] #=> String
resp.user_pool_client.logout_urls #=> Array
resp.user_pool_client.logout_urls[0] #=> String
resp.user_pool_client.default_redirect_uri #=> String
resp.user_pool_client.allowed_o_auth_flows #=> Array
resp.user_pool_client.allowed_o_auth_flows[0] #=> String, one of "code", "implicit", "client_credentials"
resp.user_pool_client.allowed_o_auth_scopes #=> Array
resp.user_pool_client.allowed_o_auth_scopes[0] #=> String
resp.user_pool_client.allowed_o_auth_flows_user_pool_client #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

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

  • :client_name (required, String)

    The client name for the user pool client you would like to create.

  • :generate_secret (Boolean)

    Boolean to specify whether you want to generate a secret for the user pool client being created.

  • :refresh_token_validity (Integer)

    The time limit, in days, after which the refresh token is no longer valid and cannot be used.

  • :read_attributes (Array<String>)

    The read attributes.

  • :write_attributes (Array<String>)

    The write attributes.

  • :explicit_auth_flows (Array<String>)

    The explicit authentication flows.

  • :supported_identity_providers (Array<String>)

    A list of provider names for the identity providers that are supported on this client.

  • :callback_urls (Array<String>)

    A list of allowed callback URLs for the identity providers.

  • :logout_urls (Array<String>)

    A list of allowed logout URLs for the identity providers.

  • :default_redirect_uri (String)

    The default redirect URI. Must be in the CallbackURLs list.

  • :allowed_o_auth_flows (Array<String>)

    Set to code to initiate a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the token endpoint.

    Set to token to specify that the client should get the access token (and, optionally, ID token, based on scopes) directly.

  • :allowed_o_auth_scopes (Array<String>)

    A list of allowed OAuth scopes. Currently supported values are "phone", "email", "openid", and "Cognito".

  • :allowed_o_auth_flows_user_pool_client (Boolean)

    Set to True if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.

Returns:

See Also:



2086
2087
2088
2089
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2086

def create_user_pool_client(params = {}, options = {})
  req = build_request(:create_user_pool_client, params)
  req.send_request(options)
end

#create_user_pool_domain(params = {}) ⇒ Struct

Creates a new domain for a user pool.

Examples:

Request syntax with placeholder values


resp = client.create_user_pool_domain({
  domain: "DomainType", # required
  user_pool_id: "UserPoolIdType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain (required, String)

    The domain string.

  • :user_pool_id (required, String)

    The user pool ID.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2112
2113
2114
2115
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2112

def create_user_pool_domain(params = {}, options = {})
  req = build_request(:create_user_pool_domain, params)
  req.send_request(options)
end

#delete_group(params = {}) ⇒ Struct

Deletes a group. Currently only groups with no members can be deleted.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.delete_group({
  group_name: "GroupNameType", # required
  user_pool_id: "UserPoolIdType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the group.

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2140
2141
2142
2143
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2140

def delete_group(params = {}, options = {})
  req = build_request(:delete_group, params)
  req.send_request(options)
end

#delete_identity_provider(params = {}) ⇒ Struct

Deletes an identity provider for a user pool.

Examples:

Request syntax with placeholder values


resp = client.delete_identity_provider({
  user_pool_id: "UserPoolIdType", # required
  provider_name: "ProviderNameType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :provider_name (required, String)

    The identity provider name.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2166
2167
2168
2169
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2166

def delete_identity_provider(params = {}, options = {})
  req = build_request(:delete_identity_provider, params)
  req.send_request(options)
end

#delete_resource_server(params = {}) ⇒ Struct

Deletes a resource server.

Examples:

Request syntax with placeholder values


resp = client.delete_resource_server({
  user_pool_id: "UserPoolIdType", # required
  identifier: "ResourceServerIdentifierType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool that hosts the resource server.

  • :identifier (required, String)

    The identifier for the resource server.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2192
2193
2194
2195
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2192

def delete_resource_server(params = {}, options = {})
  req = build_request(:delete_resource_server, params)
  req.send_request(options)
end

#delete_user(params = {}) ⇒ Struct

Allows a user to delete himself or herself.

Examples:

Request syntax with placeholder values


resp = client.delete_user({
  access_token: "TokenModelType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    The access token from a request to delete a user.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2214
2215
2216
2217
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2214

def delete_user(params = {}, options = {})
  req = build_request(:delete_user, params)
  req.send_request(options)
end

#delete_user_attributes(params = {}) ⇒ Struct

Deletes the attributes for a user.

Examples:

Request syntax with placeholder values


resp = client.delete_user_attributes({
  user_attribute_names: ["AttributeNameType"], # required
  access_token: "TokenModelType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_attribute_names (required, Array<String>)

    An array of strings representing the user attribute names you wish to delete.

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

  • :access_token (required, String)

    The access token used in the request to delete user attributes.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2244
2245
2246
2247
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2244

def delete_user_attributes(params = {}, options = {})
  req = build_request(:delete_user_attributes, params)
  req.send_request(options)
end

#delete_user_pool(params = {}) ⇒ Struct

Deletes the specified Amazon Cognito user pool.

Examples:

Request syntax with placeholder values


resp = client.delete_user_pool({
  user_pool_id: "UserPoolIdType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2266
2267
2268
2269
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2266

def delete_user_pool(params = {}, options = {})
  req = build_request(:delete_user_pool, params)
  req.send_request(options)
end

#delete_user_pool_client(params = {}) ⇒ Struct

Allows the developer to delete the user pool client.

Examples:

Request syntax with placeholder values


resp = client.delete_user_pool_client({
  user_pool_id: "UserPoolIdType", # required
  client_id: "ClientIdType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to delete the client.

  • :client_id (required, String)

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2293
2294
2295
2296
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2293

def delete_user_pool_client(params = {}, options = {})
  req = build_request(:delete_user_pool_client, params)
  req.send_request(options)
end

#delete_user_pool_domain(params = {}) ⇒ Struct

Deletes a domain for a user pool.

Examples:

Request syntax with placeholder values


resp = client.delete_user_pool_domain({
  domain: "DomainType", # required
  user_pool_id: "UserPoolIdType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain (required, String)

    The domain string.

  • :user_pool_id (required, String)

    The user pool ID.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2319
2320
2321
2322
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2319

def delete_user_pool_domain(params = {}, options = {})
  req = build_request(:delete_user_pool_domain, params)
  req.send_request(options)
end

#describe_identity_provider(params = {}) ⇒ Types::DescribeIdentityProviderResponse

Gets information about a specific identity provider.

Examples:

Request syntax with placeholder values


resp = client.describe_identity_provider({
  user_pool_id: "UserPoolIdType", # required
  provider_name: "ProviderNameType", # required
})

Response structure


resp.identity_provider.user_pool_id #=> String
resp.identity_provider.provider_name #=> String
resp.identity_provider.provider_type #=> String, one of "SAML", "Facebook", "Google", "LoginWithAmazon"
resp.identity_provider.provider_details #=> Hash
resp.identity_provider.provider_details["StringType"] #=> String
resp.identity_provider.attribute_mapping #=> Hash
resp.identity_provider.attribute_mapping["AttributeMappingKeyType"] #=> String
resp.identity_provider.idp_identifiers #=> Array
resp.identity_provider.idp_identifiers[0] #=> String
resp.identity_provider.last_modified_date #=> Time
resp.identity_provider.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :provider_name (required, String)

    The identity provider name.

Returns:

See Also:



2361
2362
2363
2364
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2361

def describe_identity_provider(params = {}, options = {})
  req = build_request(:describe_identity_provider, params)
  req.send_request(options)
end

#describe_resource_server(params = {}) ⇒ Types::DescribeResourceServerResponse

Describes a resource server.

Examples:

Request syntax with placeholder values


resp = client.describe_resource_server({
  user_pool_id: "UserPoolIdType", # required
  identifier: "ResourceServerIdentifierType", # required
})

Response structure


resp.resource_server.user_pool_id #=> String
resp.resource_server.identifier #=> String
resp.resource_server.name #=> String
resp.resource_server.scopes #=> Array
resp.resource_server.scopes[0].scope_name #=> String
resp.resource_server.scopes[0].scope_description #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool that hosts the resource server.

  • :identifier (required, String)

    The identifier for the resource server

Returns:

See Also:



2398
2399
2400
2401
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2398

def describe_resource_server(params = {}, options = {})
  req = build_request(:describe_resource_server, params)
  req.send_request(options)
end

#describe_user_import_job(params = {}) ⇒ Types::DescribeUserImportJobResponse

Describes the user import job.

Examples:

Request syntax with placeholder values


resp = client.describe_user_import_job({
  user_pool_id: "UserPoolIdType", # required
  job_id: "UserImportJobIdType", # required
})

Response structure


resp.user_import_job.job_name #=> String
resp.user_import_job.job_id #=> String
resp.user_import_job.user_pool_id #=> String
resp.user_import_job.pre_signed_url #=> String
resp.user_import_job.creation_date #=> Time
resp.user_import_job.start_date #=> Time
resp.user_import_job.completion_date #=> Time
resp.user_import_job.status #=> String, one of "Created", "Pending", "InProgress", "Stopping", "Expired", "Stopped", "Failed", "Succeeded"
resp.user_import_job.cloud_watch_logs_role_arn #=> String
resp.user_import_job.imported_users #=> Integer
resp.user_import_job.skipped_users #=> Integer
resp.user_import_job.failed_users #=> Integer
resp.user_import_job.completion_message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool that the users are being imported into.

  • :job_id (required, String)

    The job ID for the user import job.

Returns:

See Also:



2443
2444
2445
2446
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2443

def describe_user_import_job(params = {}, options = {})
  req = build_request(:describe_user_import_job, params)
  req.send_request(options)
end

#describe_user_pool(params = {}) ⇒ Types::DescribeUserPoolResponse

Returns the configuration information and metadata of the specified user pool.

Examples:

Request syntax with placeholder values


resp = client.describe_user_pool({
  user_pool_id: "UserPoolIdType", # required
})

Response structure


resp.user_pool.id #=> String
resp.user_pool.name #=> String
resp.user_pool.policies.password_policy.minimum_length #=> Integer
resp.user_pool.policies.password_policy.require_uppercase #=> Boolean
resp.user_pool.policies.password_policy.require_lowercase #=> Boolean
resp.user_pool.policies.password_policy.require_numbers #=> Boolean
resp.user_pool.policies.password_policy.require_symbols #=> Boolean
resp.user_pool.lambda_config. #=> String
resp.user_pool.lambda_config.custom_message #=> String
resp.user_pool.lambda_config.post_confirmation #=> String
resp.user_pool.lambda_config.pre_authentication #=> String
resp.user_pool.lambda_config.post_authentication #=> String
resp.user_pool.lambda_config.define_auth_challenge #=> String
resp.user_pool.lambda_config.create_auth_challenge #=> String
resp.user_pool.lambda_config.verify_auth_challenge_response #=> String
resp.user_pool.status #=> String, one of "Enabled", "Disabled"
resp.user_pool.last_modified_date #=> Time
resp.user_pool.creation_date #=> Time
resp.user_pool.schema_attributes #=> Array
resp.user_pool.schema_attributes[0].name #=> String
resp.user_pool.schema_attributes[0].attribute_data_type #=> String, one of "String", "Number", "DateTime", "Boolean"
resp.user_pool.schema_attributes[0].developer_only_attribute #=> Boolean
resp.user_pool.schema_attributes[0].mutable #=> Boolean
resp.user_pool.schema_attributes[0].required #=> Boolean
resp.user_pool.schema_attributes[0].number_attribute_constraints.min_value #=> String
resp.user_pool.schema_attributes[0].number_attribute_constraints.max_value #=> String
resp.user_pool.schema_attributes[0].string_attribute_constraints.min_length #=> String
resp.user_pool.schema_attributes[0].string_attribute_constraints.max_length #=> String
resp.user_pool.auto_verified_attributes #=> Array
resp.user_pool.auto_verified_attributes[0] #=> String, one of "phone_number", "email"
resp.user_pool.alias_attributes #=> Array
resp.user_pool.alias_attributes[0] #=> String, one of "phone_number", "email", "preferred_username"
resp.user_pool.username_attributes #=> Array
resp.user_pool.username_attributes[0] #=> String, one of "phone_number", "email"
resp.user_pool.sms_verification_message #=> String
resp.user_pool.email_verification_message #=> String
resp.user_pool.email_verification_subject #=> String
resp.user_pool.verification_message_template.sms_message #=> String
resp.user_pool.verification_message_template.email_message #=> String
resp.user_pool.verification_message_template.email_subject #=> String
resp.user_pool.verification_message_template.email_message_by_link #=> String
resp.user_pool.verification_message_template.email_subject_by_link #=> String
resp.user_pool.verification_message_template.default_email_option #=> String, one of "CONFIRM_WITH_LINK", "CONFIRM_WITH_CODE"
resp.user_pool.sms_authentication_message #=> String
resp.user_pool.mfa_configuration #=> String, one of "OFF", "ON", "OPTIONAL"
resp.user_pool.device_configuration.challenge_required_on_new_device #=> Boolean
resp.user_pool.device_configuration.device_only_remembered_on_user_prompt #=> Boolean
resp.user_pool.estimated_number_of_users #=> Integer
resp.user_pool.email_configuration.source_arn #=> String
resp.user_pool.email_configuration.reply_to_email_address #=> String
resp.user_pool.sms_configuration.sns_caller_arn #=> String
resp.user_pool.sms_configuration.external_id #=> String
resp.user_pool.user_pool_tags #=> Hash
resp.user_pool.user_pool_tags["StringType"] #=> String
resp.user_pool.sms_configuration_failure #=> String
resp.user_pool.email_configuration_failure #=> String
resp.user_pool.admin_create_user_config.allow_admin_create_user_only #=> Boolean
resp.user_pool.admin_create_user_config. #=> Integer
resp.user_pool.admin_create_user_config.invite_message_template.sms_message #=> String
resp.user_pool.admin_create_user_config.invite_message_template.email_message #=> String
resp.user_pool.admin_create_user_config.invite_message_template.email_subject #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool you want to describe.

Returns:

See Also:



2532
2533
2534
2535
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2532

def describe_user_pool(params = {}, options = {})
  req = build_request(:describe_user_pool, params)
  req.send_request(options)
end

#describe_user_pool_client(params = {}) ⇒ Types::DescribeUserPoolClientResponse

Client method for returning the configuration information and metadata of the specified user pool client.

Examples:

Request syntax with placeholder values


resp = client.describe_user_pool_client({
  user_pool_id: "UserPoolIdType", # required
  client_id: "ClientIdType", # required
})

Response structure


resp.user_pool_client.user_pool_id #=> String
resp.user_pool_client.client_name #=> String
resp.user_pool_client.client_id #=> String
resp.user_pool_client.client_secret #=> String
resp.user_pool_client.last_modified_date #=> Time
resp.user_pool_client.creation_date #=> Time
resp.user_pool_client.refresh_token_validity #=> Integer
resp.user_pool_client.read_attributes #=> Array
resp.user_pool_client.read_attributes[0] #=> String
resp.user_pool_client.write_attributes #=> Array
resp.user_pool_client.write_attributes[0] #=> String
resp.user_pool_client.explicit_auth_flows #=> Array
resp.user_pool_client.explicit_auth_flows[0] #=> String, one of "ADMIN_NO_SRP_AUTH", "CUSTOM_AUTH_FLOW_ONLY"
resp.user_pool_client.supported_identity_providers #=> Array
resp.user_pool_client.supported_identity_providers[0] #=> String
resp.user_pool_client.callback_urls #=> Array
resp.user_pool_client.callback_urls[0] #=> String
resp.user_pool_client.logout_urls #=> Array
resp.user_pool_client.logout_urls[0] #=> String
resp.user_pool_client.default_redirect_uri #=> String
resp.user_pool_client.allowed_o_auth_flows #=> Array
resp.user_pool_client.allowed_o_auth_flows[0] #=> String, one of "code", "implicit", "client_credentials"
resp.user_pool_client.allowed_o_auth_scopes #=> Array
resp.user_pool_client.allowed_o_auth_scopes[0] #=> String
resp.user_pool_client.allowed_o_auth_flows_user_pool_client #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool you want to describe.

  • :client_id (required, String)

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

Returns:

See Also:



2589
2590
2591
2592
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2589

def describe_user_pool_client(params = {}, options = {})
  req = build_request(:describe_user_pool_client, params)
  req.send_request(options)
end

#describe_user_pool_domain(params = {}) ⇒ Types::DescribeUserPoolDomainResponse

Gets information about a domain.

Examples:

Request syntax with placeholder values


resp = client.describe_user_pool_domain({
  domain: "DomainType", # required
})

Response structure


resp.domain_description.user_pool_id #=> String
resp.domain_description. #=> String
resp.domain_description.domain #=> String
resp.domain_description.s3_bucket #=> String
resp.domain_description.cloud_front_distribution #=> String
resp.domain_description.version #=> String
resp.domain_description.status #=> String, one of "CREATING", "DELETING", "UPDATING", "ACTIVE", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain (required, String)

    The domain string.

Returns:

See Also:



2623
2624
2625
2626
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2623

def describe_user_pool_domain(params = {}, options = {})
  req = build_request(:describe_user_pool_domain, params)
  req.send_request(options)
end

#forget_device(params = {}) ⇒ Struct

Forgets the specified device.

Examples:

Request syntax with placeholder values


resp = client.forget_device({
  access_token: "TokenModelType",
  device_key: "DeviceKeyType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (String)

    The access token for the forgotten device request.

  • :device_key (required, String)

    The device key.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2649
2650
2651
2652
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2649

def forget_device(params = {}, options = {})
  req = build_request(:forget_device, params)
  req.send_request(options)
end

#forgot_password(params = {}) ⇒ Types::ForgotPasswordResponse

Calling this API causes a message to be sent to the end user with a confirmation code that is required to change the user's password. For the Username parameter, you can use the username or user alias. If a verified phone number exists for the user, the confirmation code is sent to the phone number. Otherwise, if a verified email exists, the confirmation code is sent to the email. If neither a verified phone number nor a verified email exists, InvalidParameterException is thrown. To use the confirmation code for resetting the password, call ConfirmForgotPassword.

Examples:

Request syntax with placeholder values


resp = client.forgot_password({
  client_id: "ClientIdType", # required
  secret_hash: "SecretHashType",
  username: "UsernameType", # required
})

Response structure


resp.code_delivery_details.destination #=> String
resp.code_delivery_details.delivery_medium #=> String, one of "SMS", "EMAIL"
resp.code_delivery_details.attribute_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :client_id (required, String)

    The ID of the client associated with the user pool.

  • :secret_hash (String)

    A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.

  • :username (required, String)

    The user name of the user for whom you want to enter a code to reset a forgotten password.

Returns:

See Also:



2698
2699
2700
2701
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2698

def forgot_password(params = {}, options = {})
  req = build_request(:forgot_password, params)
  req.send_request(options)
end

#get_csv_header(params = {}) ⇒ Types::GetCSVHeaderResponse

Gets the header information for the .csv file to be used as input for the user import job.

Examples:

Request syntax with placeholder values


resp = client.get_csv_header({
  user_pool_id: "UserPoolIdType", # required
})

Response structure


resp.user_pool_id #=> String
resp.csv_header #=> Array
resp.csv_header[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool that the users are to be imported into.

Returns:

See Also:



2731
2732
2733
2734
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2731

def get_csv_header(params = {}, options = {})
  req = build_request(:get_csv_header, params)
  req.send_request(options)
end

#get_device(params = {}) ⇒ Types::GetDeviceResponse

Gets the device.

Examples:

Request syntax with placeholder values


resp = client.get_device({
  device_key: "DeviceKeyType", # required
  access_token: "TokenModelType",
})

Response structure


resp.device.device_key #=> String
resp.device.device_attributes #=> Array
resp.device.device_attributes[0].name #=> String
resp.device.device_attributes[0].value #=> String
resp.device.device_create_date #=> Time
resp.device.device_last_modified_date #=> Time
resp.device.device_last_authenticated_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :device_key (required, String)

    The device key.

  • :access_token (String)

    The access token.

Returns:

See Also:



2769
2770
2771
2772
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2769

def get_device(params = {}, options = {})
  req = build_request(:get_device, params)
  req.send_request(options)
end

#get_group(params = {}) ⇒ Types::GetGroupResponse

Gets a group.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.get_group({
  group_name: "GroupNameType", # required
  user_pool_id: "UserPoolIdType", # required
})

Response structure


resp.group.group_name #=> String
resp.group.user_pool_id #=> String
resp.group.description #=> String
resp.group.role_arn #=> String
resp.group.precedence #=> Integer
resp.group.last_modified_date #=> Time
resp.group.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the group.

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

Returns:

See Also:



2809
2810
2811
2812
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2809

def get_group(params = {}, options = {})
  req = build_request(:get_group, params)
  req.send_request(options)
end

#get_identity_provider_by_identifier(params = {}) ⇒ Types::GetIdentityProviderByIdentifierResponse

Gets the specified identity provider.

Examples:

Request syntax with placeholder values


resp = client.get_identity_provider_by_identifier({
  user_pool_id: "UserPoolIdType", # required
  idp_identifier: "IdpIdentifierType", # required
})

Response structure


resp.identity_provider.user_pool_id #=> String
resp.identity_provider.provider_name #=> String
resp.identity_provider.provider_type #=> String, one of "SAML", "Facebook", "Google", "LoginWithAmazon"
resp.identity_provider.provider_details #=> Hash
resp.identity_provider.provider_details["StringType"] #=> String
resp.identity_provider.attribute_mapping #=> Hash
resp.identity_provider.attribute_mapping["AttributeMappingKeyType"] #=> String
resp.identity_provider.idp_identifiers #=> Array
resp.identity_provider.idp_identifiers[0] #=> String
resp.identity_provider.last_modified_date #=> Time
resp.identity_provider.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :idp_identifier (required, String)

    The identity provider ID.

Returns:

See Also:



2851
2852
2853
2854
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2851

def get_identity_provider_by_identifier(params = {}, options = {})
  req = build_request(:get_identity_provider_by_identifier, params)
  req.send_request(options)
end

#get_ui_customization(params = {}) ⇒ Types::GetUICustomizationResponse

Gets the UI Customization information for a particular app client's app UI, if there is something set. If nothing is set for the particular client, but there is an existing pool level customization (app clientId will be ALL), then that is returned. If nothing is present, then an empty shape is returned.

Examples:

Request syntax with placeholder values


resp = client.get_ui_customization({
  user_pool_id: "UserPoolIdType", # required
  client_id: "ClientIdType",
})

Response structure


resp.ui_customization.user_pool_id #=> String
resp.ui_customization.client_id #=> String
resp.ui_customization.image_url #=> String
resp.ui_customization.css #=> String
resp.ui_customization.css_version #=> String
resp.ui_customization.last_modified_date #=> Time
resp.ui_customization.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :client_id (String)

    The client ID for the client app.

Returns:

See Also:



2893
2894
2895
2896
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2893

def get_ui_customization(params = {}, options = {})
  req = build_request(:get_ui_customization, params)
  req.send_request(options)
end

#get_user(params = {}) ⇒ Types::GetUserResponse

Gets the user attributes and metadata for a user.

Examples:

Request syntax with placeholder values


resp = client.get_user({
  access_token: "TokenModelType", # required
})

Response structure


resp.username #=> String
resp.user_attributes #=> Array
resp.user_attributes[0].name #=> String
resp.user_attributes[0].value #=> String
resp.mfa_options #=> Array
resp.mfa_options[0].delivery_medium #=> String, one of "SMS", "EMAIL"
resp.mfa_options[0].attribute_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    The access token returned by the server response to get information about the user.

Returns:

See Also:



2930
2931
2932
2933
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2930

def get_user(params = {}, options = {})
  req = build_request(:get_user, params)
  req.send_request(options)
end

#get_user_attribute_verification_code(params = {}) ⇒ Types::GetUserAttributeVerificationCodeResponse

Gets the user attribute verification code for the specified attribute name.

Examples:

Request syntax with placeholder values


resp = client.get_user_attribute_verification_code({
  access_token: "TokenModelType", # required
  attribute_name: "AttributeNameType", # required
})

Response structure


resp.code_delivery_details.destination #=> String
resp.code_delivery_details.delivery_medium #=> String, one of "SMS", "EMAIL"
resp.code_delivery_details.attribute_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    The access token returned by the server response to get the user attribute verification code.

  • :attribute_name (required, String)

    The attribute name returned by the server response to get the user attribute verification code.

Returns:

See Also:



2967
2968
2969
2970
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2967

def get_user_attribute_verification_code(params = {}, options = {})
  req = build_request(:get_user_attribute_verification_code, params)
  req.send_request(options)
end

#global_sign_out(params = {}) ⇒ Struct

Signs out users from all devices.

Examples:

Request syntax with placeholder values


resp = client.global_sign_out({
  access_token: "TokenModelType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    The access token.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2989
2990
2991
2992
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 2989

def global_sign_out(params = {}, options = {})
  req = build_request(:global_sign_out, params)
  req.send_request(options)
end

#initiate_auth(params = {}) ⇒ Types::InitiateAuthResponse

Initiates the authentication flow.

Examples:

Request syntax with placeholder values


resp = client.initiate_auth({
  auth_flow: "USER_SRP_AUTH", # required, accepts USER_SRP_AUTH, REFRESH_TOKEN_AUTH, REFRESH_TOKEN, CUSTOM_AUTH, ADMIN_NO_SRP_AUTH
  auth_parameters: {
    "StringType" => "StringType",
  },
  client_metadata: {
    "StringType" => "StringType",
  },
  client_id: "ClientIdType", # required
})

Response structure


resp.challenge_name #=> String, one of "SMS_MFA", "PASSWORD_VERIFIER", "CUSTOM_CHALLENGE", "DEVICE_SRP_AUTH", "DEVICE_PASSWORD_VERIFIER", "ADMIN_NO_SRP_AUTH", "NEW_PASSWORD_REQUIRED"
resp.session #=> String
resp.challenge_parameters #=> Hash
resp.challenge_parameters["StringType"] #=> String
resp.authentication_result.access_token #=> String
resp.authentication_result.expires_in #=> Integer
resp.authentication_result.token_type #=> String
resp.authentication_result.refresh_token #=> String
resp.authentication_result.id_token #=> String
resp.authentication_result..device_key #=> String
resp.authentication_result..device_group_key #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :auth_flow (required, String)

    The authentication flow for this call to execute. The API action will depend on this value. For example:

    • REFRESH_TOKEN_AUTH will take in a valid refresh token and return new tokens.

    • USER_SRP_AUTH will take in USERNAME and SRP_A and return the SRP variables to be used for next challenge execution.

    Valid values include:

    • USER_SRP_AUTH: Authentication flow for the Secure Remote Password (SRP) protocol.

    • REFRESH_TOKEN_AUTH/REFRESH_TOKEN: Authentication flow for refreshing the access token and ID token by supplying a valid refresh token.

    • CUSTOM_AUTH: Custom authentication flow.

    ADMIN_NO_SRP_AUTH is not a valid value.

  • :auth_parameters (Hash<String,String>)

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

    • 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 REFRESH_TOKEN_AUTH/REFRESH_TOKEN: USERNAME (required), SECRET_HASH (required if the app client is configured with a client secret), REFRESH_TOKEN (required), DEVICE_KEY

    • For CUSTOM_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY

  • :client_metadata (Hash<String,String>)

    This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda trigger as-is. It can be used to implement additional validations around authentication.

  • :client_id (required, String)

    The app client ID.

Returns:

See Also:



3081
3082
3083
3084
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3081

def initiate_auth(params = {}, options = {})
  req = build_request(:initiate_auth, params)
  req.send_request(options)
end

#list_devices(params = {}) ⇒ Types::ListDevicesResponse

Lists the devices.

Examples:

Request syntax with placeholder values


resp = client.list_devices({
  access_token: "TokenModelType", # required
  limit: 1,
  pagination_token: "SearchPaginationTokenType",
})

Response structure


resp.devices #=> Array
resp.devices[0].device_key #=> String
resp.devices[0].device_attributes #=> Array
resp.devices[0].device_attributes[0].name #=> String
resp.devices[0].device_attributes[0].value #=> String
resp.devices[0].device_create_date #=> Time
resp.devices[0].device_last_modified_date #=> Time
resp.devices[0].device_last_authenticated_date #=> Time
resp.pagination_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    The access tokens for the request to list devices.

  • :limit (Integer)

    The limit of the device request.

  • :pagination_token (String)

    The pagination token for the list request.

Returns:

See Also:



3126
3127
3128
3129
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3126

def list_devices(params = {}, options = {})
  req = build_request(:list_devices, params)
  req.send_request(options)
end

#list_groups(params = {}) ⇒ Types::ListGroupsResponse

Lists the groups associated with a user pool.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.list_groups({
  user_pool_id: "UserPoolIdType", # required
  limit: 1,
  next_token: "PaginationKey",
})

Response structure


resp.groups #=> Array
resp.groups[0].group_name #=> String
resp.groups[0].user_pool_id #=> String
resp.groups[0].description #=> String
resp.groups[0].role_arn #=> String
resp.groups[0].precedence #=> Integer
resp.groups[0].last_modified_date #=> Time
resp.groups[0].creation_date #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :limit (Integer)

    The limit of the request to list groups.

  • :next_token (String)

    An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

Returns:

See Also:



3175
3176
3177
3178
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3175

def list_groups(params = {}, options = {})
  req = build_request(:list_groups, params)
  req.send_request(options)
end

#list_identity_providers(params = {}) ⇒ Types::ListIdentityProvidersResponse

Lists information about all identity providers for a user pool.

Examples:

Request syntax with placeholder values


resp = client.list_identity_providers({
  user_pool_id: "UserPoolIdType", # required
  max_results: 1,
  next_token: "PaginationKeyType",
})

Response structure


resp.providers #=> Array
resp.providers[0].provider_name #=> String
resp.providers[0].provider_type #=> String, one of "SAML", "Facebook", "Google", "LoginWithAmazon"
resp.providers[0].last_modified_date #=> Time
resp.providers[0].creation_date #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :max_results (Integer)

    The maximum number of identity providers to return.

  • :next_token (String)

    A pagination token.

Returns:

See Also:



3217
3218
3219
3220
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3217

def list_identity_providers(params = {}, options = {})
  req = build_request(:list_identity_providers, params)
  req.send_request(options)
end

#list_resource_servers(params = {}) ⇒ Types::ListResourceServersResponse

Lists the resource servers for a user pool.

Examples:

Request syntax with placeholder values


resp = client.list_resource_servers({
  user_pool_id: "UserPoolIdType", # required
  max_results: 1,
  next_token: "PaginationKeyType",
})

Response structure


resp.resource_servers #=> Array
resp.resource_servers[0].user_pool_id #=> String
resp.resource_servers[0].identifier #=> String
resp.resource_servers[0].name #=> String
resp.resource_servers[0].scopes #=> Array
resp.resource_servers[0].scopes[0].scope_name #=> String
resp.resource_servers[0].scopes[0].scope_description #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :max_results (Integer)

    The maximum number of resource servers to return.

  • :next_token (String)

    A pagination token.

Returns:

See Also:



3261
3262
3263
3264
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3261

def list_resource_servers(params = {}, options = {})
  req = build_request(:list_resource_servers, params)
  req.send_request(options)
end

#list_user_import_jobs(params = {}) ⇒ Types::ListUserImportJobsResponse

Lists the user import jobs.

Examples:

Request syntax with placeholder values


resp = client.list_user_import_jobs({
  user_pool_id: "UserPoolIdType", # required
  max_results: 1, # required
  pagination_token: "PaginationKeyType",
})

Response structure


resp.user_import_jobs #=> Array
resp.user_import_jobs[0].job_name #=> String
resp.user_import_jobs[0].job_id #=> String
resp.user_import_jobs[0].user_pool_id #=> String
resp.user_import_jobs[0].pre_signed_url #=> String
resp.user_import_jobs[0].creation_date #=> Time
resp.user_import_jobs[0].start_date #=> Time
resp.user_import_jobs[0].completion_date #=> Time
resp.user_import_jobs[0].status #=> String, one of "Created", "Pending", "InProgress", "Stopping", "Expired", "Stopped", "Failed", "Succeeded"
resp.user_import_jobs[0].cloud_watch_logs_role_arn #=> String
resp.user_import_jobs[0].imported_users #=> Integer
resp.user_import_jobs[0].skipped_users #=> Integer
resp.user_import_jobs[0].failed_users #=> Integer
resp.user_import_jobs[0].completion_message #=> String
resp.pagination_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool that the users are being imported into.

  • :max_results (required, Integer)

    The maximum number of import jobs you want the request to return.

  • :pagination_token (String)

    An identifier that was returned from the previous call to ListUserImportJobs, which can be used to return the next set of import jobs in the list.

Returns:

See Also:



3315
3316
3317
3318
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3315

def list_user_import_jobs(params = {}, options = {})
  req = build_request(:list_user_import_jobs, params)
  req.send_request(options)
end

#list_user_pool_clients(params = {}) ⇒ Types::ListUserPoolClientsResponse

Lists the clients that have been created for the specified user pool.

Examples:

Request syntax with placeholder values


resp = client.list_user_pool_clients({
  user_pool_id: "UserPoolIdType", # required
  max_results: 1,
  next_token: "PaginationKey",
})

Response structure


resp.user_pool_clients #=> Array
resp.user_pool_clients[0].client_id #=> String
resp.user_pool_clients[0].user_pool_id #=> String
resp.user_pool_clients[0].client_name #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool where you want to list user pool clients.

  • :max_results (Integer)

    The maximum number of results you want the request to return when listing the user pool clients.

  • :next_token (String)

    An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

Returns:

See Also:



3360
3361
3362
3363
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3360

def list_user_pool_clients(params = {}, options = {})
  req = build_request(:list_user_pool_clients, params)
  req.send_request(options)
end

#list_user_pools(params = {}) ⇒ Types::ListUserPoolsResponse

Lists the user pools associated with an AWS account.

Examples:

Request syntax with placeholder values


resp = client.list_user_pools({
  next_token: "PaginationKeyType",
  max_results: 1, # required
})

Response structure


resp.user_pools #=> Array
resp.user_pools[0].id #=> String
resp.user_pools[0].name #=> String
resp.user_pools[0].lambda_config. #=> String
resp.user_pools[0].lambda_config.custom_message #=> String
resp.user_pools[0].lambda_config.post_confirmation #=> String
resp.user_pools[0].lambda_config.pre_authentication #=> String
resp.user_pools[0].lambda_config.post_authentication #=> String
resp.user_pools[0].lambda_config.define_auth_challenge #=> String
resp.user_pools[0].lambda_config.create_auth_challenge #=> String
resp.user_pools[0].lambda_config.verify_auth_challenge_response #=> String
resp.user_pools[0].status #=> String, one of "Enabled", "Disabled"
resp.user_pools[0].last_modified_date #=> Time
resp.user_pools[0].creation_date #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (String)

    An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

  • :max_results (required, Integer)

    The maximum number of results you want the request to return when listing the user pools.

Returns:

See Also:



3410
3411
3412
3413
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3410

def list_user_pools(params = {}, options = {})
  req = build_request(:list_user_pools, params)
  req.send_request(options)
end

#list_users(params = {}) ⇒ Types::ListUsersResponse

Lists the users in the Amazon Cognito user pool.

Examples:

Request syntax with placeholder values


resp = client.list_users({
  user_pool_id: "UserPoolIdType", # required
  attributes_to_get: ["AttributeNameType"],
  limit: 1,
  pagination_token: "SearchPaginationTokenType",
  filter: "UserFilterType",
})

Response structure


resp.users #=> Array
resp.users[0].username #=> String
resp.users[0].attributes #=> Array
resp.users[0].attributes[0].name #=> String
resp.users[0].attributes[0].value #=> String
resp.users[0].user_create_date #=> Time
resp.users[0].user_last_modified_date #=> Time
resp.users[0].enabled #=> Boolean
resp.users[0].user_status #=> String, one of "UNCONFIRMED", "CONFIRMED", "ARCHIVED", "COMPROMISED", "UNKNOWN", "RESET_REQUIRED", "FORCE_CHANGE_PASSWORD"
resp.users[0].mfa_options #=> Array
resp.users[0].mfa_options[0].delivery_medium #=> String, one of "SMS", "EMAIL"
resp.users[0].mfa_options[0].attribute_name #=> String
resp.pagination_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool on which the search should be performed.

  • :attributes_to_get (Array<String>)

    An array of strings, where each string is the name of a user attribute to be returned for each user in the search results. If the array is empty, all attributes are returned.

  • :limit (Integer)

    Maximum number of users to be returned.

  • :pagination_token (String)

    An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

  • :filter (String)

    A filter string of the form "AttributeName Filter-Type "AttributeValue"". Quotation marks within the filter string must be escaped using the backslash (\) 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 Enabled in the Console) (case-sensitive)

    • status (case-insensitive)

    Custom attributes are not searchable.

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

Returns:

See Also:



3520
3521
3522
3523
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3520

def list_users(params = {}, options = {})
  req = build_request(:list_users, params)
  req.send_request(options)
end

#list_users_in_group(params = {}) ⇒ Types::ListUsersInGroupResponse

Lists the users in the specified group.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.list_users_in_group({
  user_pool_id: "UserPoolIdType", # required
  group_name: "GroupNameType", # required
  limit: 1,
  next_token: "PaginationKey",
})

Response structure


resp.users #=> Array
resp.users[0].username #=> String
resp.users[0].attributes #=> Array
resp.users[0].attributes[0].name #=> String
resp.users[0].attributes[0].value #=> String
resp.users[0].user_create_date #=> Time
resp.users[0].user_last_modified_date #=> Time
resp.users[0].enabled #=> Boolean
resp.users[0].user_status #=> String, one of "UNCONFIRMED", "CONFIRMED", "ARCHIVED", "COMPROMISED", "UNKNOWN", "RESET_REQUIRED", "FORCE_CHANGE_PASSWORD"
resp.users[0].mfa_options #=> Array
resp.users[0].mfa_options[0].delivery_medium #=> String, one of "SMS", "EMAIL"
resp.users[0].mfa_options[0].attribute_name #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :group_name (required, String)

    The name of the group.

  • :limit (Integer)

    The limit of the request to list users.

  • :next_token (String)

    An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

Returns:

See Also:



3577
3578
3579
3580
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3577

def list_users_in_group(params = {}, options = {})
  req = build_request(:list_users_in_group, params)
  req.send_request(options)
end

#resend_confirmation_code(params = {}) ⇒ Types::ResendConfirmationCodeResponse

Resends the confirmation (for confirmation of registration) to a specific user in the user pool.

Examples:

Request syntax with placeholder values


resp = client.resend_confirmation_code({
  client_id: "ClientIdType", # required
  secret_hash: "SecretHashType",
  username: "UsernameType", # required
})

Response structure


resp.code_delivery_details.destination #=> String
resp.code_delivery_details.delivery_medium #=> String, one of "SMS", "EMAIL"
resp.code_delivery_details.attribute_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :client_id (required, String)

    The ID of the client associated with the user pool.

  • :secret_hash (String)

    A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.

  • :username (required, String)

    The user name of the user to whom you wish to resend a confirmation code.

Returns:

See Also:



3619
3620
3621
3622
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3619

def resend_confirmation_code(params = {}, options = {})
  req = build_request(:resend_confirmation_code, params)
  req.send_request(options)
end

#respond_to_auth_challenge(params = {}) ⇒ Types::RespondToAuthChallengeResponse

Responds to the authentication challenge.

Examples:

Request syntax with placeholder values


resp = client.respond_to_auth_challenge({
  client_id: "ClientIdType", # required
  challenge_name: "SMS_MFA", # required, accepts SMS_MFA, PASSWORD_VERIFIER, CUSTOM_CHALLENGE, DEVICE_SRP_AUTH, DEVICE_PASSWORD_VERIFIER, ADMIN_NO_SRP_AUTH, NEW_PASSWORD_REQUIRED
  session: "SessionType",
  challenge_responses: {
    "StringType" => "StringType",
  },
})

Response structure


resp.challenge_name #=> String, one of "SMS_MFA", "PASSWORD_VERIFIER", "CUSTOM_CHALLENGE", "DEVICE_SRP_AUTH", "DEVICE_PASSWORD_VERIFIER", "ADMIN_NO_SRP_AUTH", "NEW_PASSWORD_REQUIRED"
resp.session #=> String
resp.challenge_parameters #=> Hash
resp.challenge_parameters["StringType"] #=> String
resp.authentication_result.access_token #=> String
resp.authentication_result.expires_in #=> Integer
resp.authentication_result.token_type #=> String
resp.authentication_result.refresh_token #=> String
resp.authentication_result.id_token #=> String
resp.authentication_result..device_key #=> String
resp.authentication_result..device_group_key #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :client_id (required, String)

    The app client ID.

  • :challenge_name (required, String)

    The challenge name. For more information, see InitiateAuth.

    ADMIN_NO_SRP_AUTH is not a valid value.

  • :session (String)

    The session which should be passed both ways in challenge-response calls to the service. If InitiateAuth or RespondToAuthChallenge API call determines that the caller needs to go through another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.

  • :challenge_responses (Hash<String,String>)

    The challenge responses. These are inputs corresponding to the value of ChallengeName, for example:

    • SMS_MFA: SMS_MFA_CODE, USERNAME, SECRET_HASH (if app client is configured with client secret).

    • PASSWORD_VERIFIER: PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, TIMESTAMP, USERNAME, SECRET_HASH (if app client is configured with client secret).

    • NEW_PASSWORD_REQUIRED: NEW_PASSWORD, any other required attributes, USERNAME, SECRET_HASH (if app client is configured with client secret).

Returns:

See Also:



3694
3695
3696
3697
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3694

def respond_to_auth_challenge(params = {}, options = {})
  req = build_request(:respond_to_auth_challenge, params)
  req.send_request(options)
end

#set_ui_customization(params = {}) ⇒ Types::SetUICustomizationResponse

Sets the UI customization information for a user pool's built-in app UI.

You can specify app UI customization settings for a single client (with a specific clientId) or for all clients (by setting the clientId to ALL). If you specify ALL, the default configuration will be used for every client that has no UI customization set previously. If you specify UI customization settings for a particular client, it will no longer fall back to the ALL configuration.

To use this API, your user pool must have a domain associated with it. Otherwise, there is no place to host the app's pages, and the service will throw an error.

Examples:

Request syntax with placeholder values


resp = client.set_ui_customization({
  user_pool_id: "UserPoolIdType", # required
  client_id: "ClientIdType",
  css: "CSSType",
  image_file: "data",
})

Response structure


resp.ui_customization.user_pool_id #=> String
resp.ui_customization.client_id #=> String
resp.ui_customization.image_url #=> String
resp.ui_customization.css #=> String
resp.ui_customization.css_version #=> String
resp.ui_customization.last_modified_date #=> Time
resp.ui_customization.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :client_id (String)

    The client ID for the client app.

  • :css (String)

    The CSS values in the UI customization.

  • :image_file (String, IO)

    The uploaded logo image for the UI customization.

Returns:

See Also:



3754
3755
3756
3757
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3754

def set_ui_customization(params = {}, options = {})
  req = build_request(:set_ui_customization, params)
  req.send_request(options)
end

#set_user_settings(params = {}) ⇒ Struct

Sets the user settings like multi-factor authentication (MFA). If MFA is to be removed for a particular attribute pass the attribute with code delivery as null. If null list is passed, all MFA options are removed.

Examples:

Request syntax with placeholder values


resp = client.({
  access_token: "TokenModelType", # required
  mfa_options: [ # required
    {
      delivery_medium: "SMS", # accepts SMS, EMAIL
      attribute_name: "AttributeNameType",
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    The access token for the set user settings request.

  • :mfa_options (required, Array<Types::MFAOptionType>)

    Specifies the options for MFA (e.g., email or phone number).

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3788
3789
3790
3791
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3788

def (params = {}, options = {})
  req = build_request(:set_user_settings, params)
  req.send_request(options)
end

#sign_up(params = {}) ⇒ Types::SignUpResponse

Registers the user in the specified user pool and creates a user name, password, and user attributes.

Examples:

Request syntax with placeholder values


resp = client.({
  client_id: "ClientIdType", # required
  secret_hash: "SecretHashType",
  username: "UsernameType", # required
  password: "PasswordType", # required
  user_attributes: [
    {
      name: "AttributeNameType", # required
      value: "AttributeValueType",
    },
  ],
  validation_data: [
    {
      name: "AttributeNameType", # required
      value: "AttributeValueType",
    },
  ],
})

Response structure


resp.user_confirmed #=> Boolean
resp.code_delivery_details.destination #=> String
resp.code_delivery_details.delivery_medium #=> String, one of "SMS", "EMAIL"
resp.code_delivery_details.attribute_name #=> String
resp.user_sub #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :client_id (required, String)

    The ID of the client associated with the user pool.

  • :secret_hash (String)

    A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.

  • :username (required, String)

    The user name of the user you wish to register.

  • :password (required, String)

    The password of the user you wish to register.

  • :user_attributes (Array<Types::AttributeType>)

    An array of name-value pairs representing user attributes.

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

  • :validation_data (Array<Types::AttributeType>)

    The validation data in the request to register a user.

Returns:

See Also:



3858
3859
3860
3861
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3858

def (params = {}, options = {})
  req = build_request(:sign_up, params)
  req.send_request(options)
end

#start_user_import_job(params = {}) ⇒ Types::StartUserImportJobResponse

Starts the user import.

Examples:

Request syntax with placeholder values


resp = client.start_user_import_job({
  user_pool_id: "UserPoolIdType", # required
  job_id: "UserImportJobIdType", # required
})

Response structure


resp.user_import_job.job_name #=> String
resp.user_import_job.job_id #=> String
resp.user_import_job.user_pool_id #=> String
resp.user_import_job.pre_signed_url #=> String
resp.user_import_job.creation_date #=> Time
resp.user_import_job.start_date #=> Time
resp.user_import_job.completion_date #=> Time
resp.user_import_job.status #=> String, one of "Created", "Pending", "InProgress", "Stopping", "Expired", "Stopped", "Failed", "Succeeded"
resp.user_import_job.cloud_watch_logs_role_arn #=> String
resp.user_import_job.imported_users #=> Integer
resp.user_import_job.skipped_users #=> Integer
resp.user_import_job.failed_users #=> Integer
resp.user_import_job.completion_message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool that the users are being imported into.

  • :job_id (required, String)

    The job ID for the user import job.

Returns:

See Also:



3903
3904
3905
3906
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3903

def start_user_import_job(params = {}, options = {})
  req = build_request(:start_user_import_job, params)
  req.send_request(options)
end

#stop_user_import_job(params = {}) ⇒ Types::StopUserImportJobResponse

Stops the user import job.

Examples:

Request syntax with placeholder values


resp = client.stop_user_import_job({
  user_pool_id: "UserPoolIdType", # required
  job_id: "UserImportJobIdType", # required
})

Response structure


resp.user_import_job.job_name #=> String
resp.user_import_job.job_id #=> String
resp.user_import_job.user_pool_id #=> String
resp.user_import_job.pre_signed_url #=> String
resp.user_import_job.creation_date #=> Time
resp.user_import_job.start_date #=> Time
resp.user_import_job.completion_date #=> Time
resp.user_import_job.status #=> String, one of "Created", "Pending", "InProgress", "Stopping", "Expired", "Stopped", "Failed", "Succeeded"
resp.user_import_job.cloud_watch_logs_role_arn #=> String
resp.user_import_job.imported_users #=> Integer
resp.user_import_job.skipped_users #=> Integer
resp.user_import_job.failed_users #=> Integer
resp.user_import_job.completion_message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool that the users are being imported into.

  • :job_id (required, String)

    The job ID for the user import job.

Returns:

See Also:



3948
3949
3950
3951
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3948

def stop_user_import_job(params = {}, options = {})
  req = build_request(:stop_user_import_job, params)
  req.send_request(options)
end

#update_device_status(params = {}) ⇒ Struct

Updates the device status.

Examples:

Request syntax with placeholder values


resp = client.update_device_status({
  access_token: "TokenModelType", # required
  device_key: "DeviceKeyType", # required
  device_remembered_status: "remembered", # accepts remembered, not_remembered
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    The access token.

  • :device_key (required, String)

    The device key.

  • :device_remembered_status (String)

    The status of whether a device is remembered.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3978
3979
3980
3981
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 3978

def update_device_status(params = {}, options = {})
  req = build_request(:update_device_status, params)
  req.send_request(options)
end

#update_group(params = {}) ⇒ Types::UpdateGroupResponse

Updates the specified group with the specified attributes.

Requires developer credentials.

Examples:

Request syntax with placeholder values


resp = client.update_group({
  group_name: "GroupNameType", # required
  user_pool_id: "UserPoolIdType", # required
  description: "DescriptionType",
  role_arn: "ArnType",
  precedence: 1,
})

Response structure


resp.group.group_name #=> String
resp.group.user_pool_id #=> String
resp.group.description #=> String
resp.group.role_arn #=> String
resp.group.precedence #=> Integer
resp.group.last_modified_date #=> Time
resp.group.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the group.

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :description (String)

    A string containing the new description of the group.

  • :role_arn (String)

    The new role ARN for the group. This is used for setting the cognito:roles and cognito:preferred_role claims in the token.

  • :precedence (Integer)

    The new precedence value for the group. For more information about this parameter, see CreateGroup.

Returns:

See Also:



4032
4033
4034
4035
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 4032

def update_group(params = {}, options = {})
  req = build_request(:update_group, params)
  req.send_request(options)
end

#update_identity_provider(params = {}) ⇒ Types::UpdateIdentityProviderResponse

Updates identity provider information for a user pool.

Examples:

Request syntax with placeholder values


resp = client.update_identity_provider({
  user_pool_id: "UserPoolIdType", # required
  provider_name: "ProviderNameType", # required
  provider_details: {
    "StringType" => "StringType",
  },
  attribute_mapping: {
    "AttributeMappingKeyType" => "StringType",
  },
  idp_identifiers: ["IdpIdentifierType"],
})

Response structure


resp.identity_provider.user_pool_id #=> String
resp.identity_provider.provider_name #=> String
resp.identity_provider.provider_type #=> String, one of "SAML", "Facebook", "Google", "LoginWithAmazon"
resp.identity_provider.provider_details #=> Hash
resp.identity_provider.provider_details["StringType"] #=> String
resp.identity_provider.attribute_mapping #=> Hash
resp.identity_provider.attribute_mapping["AttributeMappingKeyType"] #=> String
resp.identity_provider.idp_identifiers #=> Array
resp.identity_provider.idp_identifiers[0] #=> String
resp.identity_provider.last_modified_date #=> Time
resp.identity_provider.creation_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID.

  • :provider_name (required, String)

    The identity provider name.

  • :provider_details (Hash<String,String>)

    The identity provider details to be updated, such as MetadataURL and MetadataFile.

  • :attribute_mapping (Hash<String,String>)

    The identity provider attribute mapping to be changed.

  • :idp_identifiers (Array<String>)

    A list of identity provider identifiers.

Returns:

See Also:



4091
4092
4093
4094
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 4091

def update_identity_provider(params = {}, options = {})
  req = build_request(:update_identity_provider, params)
  req.send_request(options)
end

#update_resource_server(params = {}) ⇒ Types::UpdateResourceServerResponse

Updates the name and scopes of resource server. All other fields are read-only.

Examples:

Request syntax with placeholder values


resp = client.update_resource_server({
  user_pool_id: "UserPoolIdType", # required
  identifier: "ResourceServerIdentifierType", # required
  name: "ResourceServerNameType", # required
  scopes: [
    {
      scope_name: "ResourceServerScopeNameType", # required
      scope_description: "ResourceServerScopeDescriptionType", # required
    },
  ],
})

Response structure


resp.resource_server.user_pool_id #=> String
resp.resource_server.identifier #=> String
resp.resource_server.name #=> String
resp.resource_server.scopes #=> Array
resp.resource_server.scopes[0].scope_name #=> String
resp.resource_server.scopes[0].scope_description #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool.

  • :identifier (required, String)

    The identifier for the resource server.

  • :name (required, String)

    The name of the resource server.

  • :scopes (Array<Types::ResourceServerScopeType>)

    The scope values to be set for the resource server.

Returns:

See Also:



4142
4143
4144
4145
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 4142

def update_resource_server(params = {}, options = {})
  req = build_request(:update_resource_server, params)
  req.send_request(options)
end

#update_user_attributes(params = {}) ⇒ Types::UpdateUserAttributesResponse

Allows a user to update a specific attribute (one at a time).

Examples:

Request syntax with placeholder values


resp = client.update_user_attributes({
  user_attributes: [ # required
    {
      name: "AttributeNameType", # required
      value: "AttributeValueType",
    },
  ],
  access_token: "TokenModelType", # required
})

Response structure


resp.code_delivery_details_list #=> Array
resp.code_delivery_details_list[0].destination #=> String
resp.code_delivery_details_list[0].delivery_medium #=> String, one of "SMS", "EMAIL"
resp.code_delivery_details_list[0].attribute_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_attributes (required, Array<Types::AttributeType>)

    An array of name-value pairs representing user attributes.

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

  • :access_token (required, String)

    The access token for the request to update user attributes.

Returns:

See Also:



4185
4186
4187
4188
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 4185

def update_user_attributes(params = {}, options = {})
  req = build_request(:update_user_attributes, params)
  req.send_request(options)
end

#update_user_pool(params = {}) ⇒ Struct

Updates the specified user pool with the specified attributes.

Examples:

Request syntax with placeholder values


resp = client.update_user_pool({
  user_pool_id: "UserPoolIdType", # required
  policies: {
    password_policy: {
      minimum_length: 1,
      require_uppercase: false,
      require_lowercase: false,
      require_numbers: false,
      require_symbols: false,
    },
  },
  lambda_config: {
    pre_sign_up: "ArnType",
    custom_message: "ArnType",
    post_confirmation: "ArnType",
    pre_authentication: "ArnType",
    post_authentication: "ArnType",
    define_auth_challenge: "ArnType",
    create_auth_challenge: "ArnType",
    verify_auth_challenge_response: "ArnType",
  },
  auto_verified_attributes: ["phone_number"], # accepts phone_number, email
  sms_verification_message: "SmsVerificationMessageType",
  email_verification_message: "EmailVerificationMessageType",
  email_verification_subject: "EmailVerificationSubjectType",
  verification_message_template: {
    sms_message: "SmsVerificationMessageType",
    email_message: "EmailVerificationMessageType",
    email_subject: "EmailVerificationSubjectType",
    email_message_by_link: "EmailVerificationMessageByLinkType",
    email_subject_by_link: "EmailVerificationSubjectByLinkType",
    default_email_option: "CONFIRM_WITH_LINK", # accepts CONFIRM_WITH_LINK, CONFIRM_WITH_CODE
  },
  sms_authentication_message: "SmsVerificationMessageType",
  mfa_configuration: "OFF", # accepts OFF, ON, OPTIONAL
  device_configuration: {
    challenge_required_on_new_device: false,
    device_only_remembered_on_user_prompt: false,
  },
  email_configuration: {
    source_arn: "ArnType",
    reply_to_email_address: "EmailAddressType",
  },
  sms_configuration: {
    sns_caller_arn: "ArnType", # required
    external_id: "StringType",
  },
  user_pool_tags: {
    "StringType" => "StringType",
  },
  admin_create_user_config: {
    allow_admin_create_user_only: false,
    unused_account_validity_days: 1,
    invite_message_template: {
      sms_message: "SmsVerificationMessageType",
      email_message: "EmailVerificationMessageType",
      email_subject: "EmailVerificationSubjectType",
    },
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

    The user pool ID for the user pool you want to update.

  • :policies (Types::UserPoolPolicyType)

    A container with the policies you wish to update in a user pool.

  • :lambda_config (Types::LambdaConfigType)

    The AWS Lambda configuration information from the request to update the user pool.

  • :auto_verified_attributes (Array<String>)

    The attributes that are automatically verified when the Amazon Cognito service makes a request to update user pools.

  • :sms_verification_message (String)

    A container with information about the SMS verification message.

  • :email_verification_message (String)

    The contents of the email verification message.

  • :email_verification_subject (String)

    The subject of the email verification message.

  • :verification_message_template (Types::VerificationMessageTemplateType)

    The template for verification messages.

  • :sms_authentication_message (String)

    The contents of the SMS authentication message.

  • :mfa_configuration (String)

    Can be one of the following values:

    • OFF - MFA tokens are not required and cannot be specified during user registration.

    • ON - MFA tokens are required for all user registrations. You can only specify required when you are initially creating a user pool.

    • OPTIONAL - Users have the option when registering to create an MFA token.

  • :device_configuration (Types::DeviceConfigurationType)

    Device configuration.

  • :email_configuration (Types::EmailConfigurationType)

    Email configuration.

  • :sms_configuration (Types::SmsConfigurationType)

    SMS configuration.

  • :user_pool_tags (Hash<String,String>)

    The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

  • :admin_create_user_config (Types::AdminCreateUserConfigType)

    The configuration for AdminCreateUser requests.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



4322
4323
4324
4325
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 4322

def update_user_pool(params = {}, options = {})
  req = build_request(:update_user_pool, params)
  req.send_request(options)
end

#update_user_pool_client(params = {}) ⇒ Types::UpdateUserPoolClientResponse

Allows the developer to update the specified user pool client and password policy.

Examples:

Request syntax with placeholder values


resp = client.update_user_pool_client({
  user_pool_id: "UserPoolIdType", # required
  client_id: "ClientIdType", # required
  client_name: "ClientNameType",
  refresh_token_validity: 1,
  read_attributes: ["ClientPermissionType"],
  write_attributes: ["ClientPermissionType"],
  explicit_auth_flows: ["ADMIN_NO_SRP_AUTH"], # accepts ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY
  supported_identity_providers: ["ProviderNameType"],
  callback_urls: ["RedirectUrlType"],
  logout_urls: ["RedirectUrlType"],
  default_redirect_uri: "RedirectUrlType",
  allowed_o_auth_flows: ["code"], # accepts code, implicit, client_credentials
  allowed_o_auth_scopes: ["ScopeType"],
  allowed_o_auth_flows_user_pool_client: false,
})

Response structure


resp.user_pool_client.user_pool_id #=> String
resp.user_pool_client.client_name #=> String
resp.user_pool_client.client_id #=> String
resp.user_pool_client.client_secret #=> String
resp.user_pool_client.last_modified_date #=> Time
resp.user_pool_client.creation_date #=> Time
resp.user_pool_client.refresh_token_validity #=> Integer
resp.user_pool_client.read_attributes #=> Array
resp.user_pool_client.read_attributes[0] #=> String
resp.user_pool_client.write_attributes #=> Array
resp.user_pool_client.write_attributes[0] #=> String
resp.user_pool_client.explicit_auth_flows #=> Array
resp.user_pool_client.explicit_auth_flows[0] #=> String, one of "ADMIN_NO_SRP_AUTH", "CUSTOM_AUTH_FLOW_ONLY"
resp.user_pool_client.supported_identity_providers #=> Array
resp.user_pool_client.supported_identity_providers[0] #=> String
resp.user_pool_client.callback_urls #=> Array
resp.user_pool_client.callback_urls[0] #=> String
resp.user_pool_client.logout_urls #=> Array
resp.user_pool_client.logout_urls[0] #=> String
resp.user_pool_client.default_redirect_uri #=> String
resp.user_pool_client.allowed_o_auth_flows #=> Array
resp.user_pool_client.allowed_o_auth_flows[0] #=> String, one of "code", "implicit", "client_credentials"
resp.user_pool_client.allowed_o_auth_scopes #=> Array
resp.user_pool_client.allowed_o_auth_scopes[0] #=> String
resp.user_pool_client.allowed_o_auth_flows_user_pool_client #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :user_pool_id (required, String)

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

  • :client_id (required, String)

    The ID of the client associated with the user pool.

  • :client_name (String)

    The client name from the update user pool client request.

  • :refresh_token_validity (Integer)

    The time limit, in days, after which the refresh token is no longer valid and cannot be used.

  • :read_attributes (Array<String>)

    The read-only attributes of the user pool.

  • :write_attributes (Array<String>)

    The writeable attributes of the user pool.

  • :explicit_auth_flows (Array<String>)

    Explicit authentication flows.

  • :supported_identity_providers (Array<String>)

    A list of provider names for the identity providers that are supported on this client.

  • :callback_urls (Array<String>)

    A list of allowed callback URLs for the identity providers.

  • :logout_urls (Array<String>)

    A list of allowed logout URLs for the identity providers.

  • :default_redirect_uri (String)

    The default redirect URI. Must be in the CallbackURLs list.

  • :allowed_o_auth_flows (Array<String>)

    Set to code to initiate a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the token endpoint.

    Set to token to specify that the client should get the access token (and, optionally, ID token, based on scopes) directly.

  • :allowed_o_auth_scopes (Array<String>)

    A list of allowed OAuth scopes. Currently supported values are "phone", "email", "openid", and "Cognito".

  • :allowed_o_auth_flows_user_pool_client (Boolean)

    Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.

Returns:

See Also:



4437
4438
4439
4440
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 4437

def update_user_pool_client(params = {}, options = {})
  req = build_request(:update_user_pool_client, params)
  req.send_request(options)
end

#verify_user_attribute(params = {}) ⇒ Struct

Verifies the specified user attributes in the user pool.

Examples:

Request syntax with placeholder values


resp = client.verify_user_attribute({
  access_token: "TokenModelType", # required
  attribute_name: "AttributeNameType", # required
  code: "ConfirmationCodeType", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :access_token (required, String)

    Represents the access token of the request to verify user attributes.

  • :attribute_name (required, String)

    The attribute name in the request to verify user attributes.

  • :code (required, String)

    The verification code in the request to verify user attributes.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



4467
4468
4469
4470
# File 'gems/aws-sdk-cognitoidentityprovider/lib/aws-sdk-cognitoidentityprovider/client.rb', line 4467

def verify_user_attribute(params = {}, options = {})
  req = build_request(:verify_user_attribute, params)
  req.send_request(options)
end