associate

IAM.MfaDevice.associate(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = mfa_device.associate(
    AuthenticationCode1='string',
    AuthenticationCode2='string'
)
Parameters
  • AuthenticationCode1 (string) --

    [REQUIRED]

    An authentication code emitted by the device.

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

    Warning

    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.

  • AuthenticationCode2 (string) --

    [REQUIRED]

    A subsequent authentication code emitted by the device.

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

    Warning

    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

None