edit-icon download-icon

BindMFADevice

Last Updated: Nov 10, 2017

Interface description

Binds an MFA device.

Request parameters

Action

  • Type: String
  • Required: Yes
  • Description: Operation interface, required. The parameter value is “BindMFADevice”.

SerialNumber

  • Type: String
  • Required: Yes
  • Description: Serial number of an MFA device.

UserName

  • Type: String
  • Required: Yes
  • Description: User name.

AuthenticationCode1

  • Type: String
  • Required: Yes
  • Description: Authenticates the first group of dynamic passwords.

AuthenticationCode2

  • Type: String
  • Required: Yes
  • Description: Authenticates the second group of dynamic passwords.

Return parameters

Only public parameters are returned. For details, see Public return parameters.

Required permissions

Action

ram:BindMFADevice

Resource

acs:ram:*:${AccountId}:user/${UserName}

Error messages

InvalidParameter.UserName.InvalidChars
  • HTTP Status: 400
  • Error Message: The parameter - “UserName” contains invalid chars.
InvalidParameter.UserName.Length
  • HTTP Status: 400
  • Error Message: The parameter - “UserName” beyond the length limit.
InvalidParameter.AuthenticationCode.Format
  • HTTP Status: 400
  • Error Message: The parameter - “AuthenticationCode” MUST be 6 numbers.
CheckAuthenticationCodeFail
  • HTTP Status: 403
  • Error Message: The authentication code is incorrect.
EntityNotExist.User
  • HTTP Status: 404
  • Error Message: The user does not exist.
EntityNotExist.VirtualMFADevice
  • HTTP Status: 404
  • Error Message: The virtual mfa device does not exist.
EntityAlreadyExists.User.MFADevice
  • HTTP Status: 409
  • Error Message: The user has already bound a MFA device.
EntityAlreadyExists.VirtualMFADevice.User
  • HTTP Status: 409
  • Error Message: The virtual mfa device does already been bound to a user.

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=BindMFADevice
  2. &SerialNumber=acs:ram::1234567890123:mfa/device002
  3. &UserName=zhangqiang
  4. &<Public request parameters>

Return example

XML format

  1. <BindMFADeviceResponse>
  2. <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
  3. </BindMFADeviceResponse>

JSON format

  1. {
  2. "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
  3. }
Thank you! We've received your feedback.