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

Class: Aws::IAM::MfaDevice

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(user_name, serial_number, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(user_name, serial_number, options = {}) ⇒ Object

    Parameters:

    • user_name (String)
    • serial_number (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :user_name (required, String)
    • :serial_number (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#enable_dateTime (readonly)

The date when the MFA device was enabled for the user.

Returns:

  • (Time)

    The date when the MFA device was enabled for the user.

#serial_numberString (readonly)

Returns:

  • (String)

#user_nameString (readonly)

Returns:

  • (String)

Instance Method Details

#associate(options = {}) ⇒ Struct

Enables the specified MFA device and associates it with the specified IAM user. When enabled, the MFA device is required for every subsequent login by the IAM user associated with the device.

Examples:

Request syntax example with placeholder values


mfadevice.associate({
  authentication_code_1: "authenticationCodeType", # required
  authentication_code_2: "authenticationCodeType", # required
})

Options Hash (options):

  • :authentication_code_1 (required, String)

    An authentication code emitted by the device.

    The format for this parameter is a string of six digits.

    Submit your request immediately after generating the authentication codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device becomes out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device.

  • :authentication_code_2 (required, String)

    A subsequent authentication code emitted by the device.

    The format for this parameter is a string of six digits.

    Submit your request immediately after generating the authentication codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device becomes out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#disassociateStruct

Deactivates the specified MFA device and removes it from association with the user name for which it was originally enabled.

For more information about creating and working with virtual MFA devices, go to Enabling a Virtual Multi-factor Authentication (MFA) Device in the IAM User Guide.

Examples:

Request syntax example with placeholder values


mfadevice.disassociate()

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#resync(options = {}) ⇒ Struct

Synchronizes the specified MFA device with its IAM resource object on the AWS servers.

For more information about creating and working with virtual MFA devices, go to Using a Virtual MFA Device in the IAM User Guide.

Examples:

Request syntax example with placeholder values


mfadevice.resync({
  authentication_code_1: "authenticationCodeType", # required
  authentication_code_2: "authenticationCodeType", # required
})

Options Hash (options):

  • :authentication_code_1 (required, String)

    An authentication code emitted by the device.

    The format for this parameter is a sequence of six digits.

  • :authentication_code_2 (required, String)

    A subsequent authentication code emitted by the device.

    The format for this parameter is a sequence of six digits.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#userUser

Returns: