CreateVirtualMFADevice
更新時間 2024-09-19 16:53:51
最近更新時間: 2024-09-19 16:53:51
分享文章
本節主要介紹CreateVirtualMFADevice。
此操作用來創建虛擬MFA設備。創建虛擬MFA后,可以使用EnableMFADevice啟用虛擬MFA設備,并將該虛擬MFA設備與指定的IAM用戶關聯。
注意QR代碼和Base32字符串中包含的MFA設備密鑰,就像您的密碼一樣,應被妥善保管和處理。
請求示例
| 名稱 | 描述 | 是否必須 |
|---|---|---|
| Action | CreateVirtualMFADevice。 | 是 |
| Version | 請求版本。 取值 :2010-05-08。默認值為2010-05-08。 |
否 |
| VirtualMFADeviceName | 虛擬MFA設備的名稱。 類型 :字符串 取值 :1~128個字符組成,字符只能包含字母、數字或特殊字符,字母不區分大小寫,特殊字符只能是:下劃線(_)、中劃線(-)、逗號(,)、句點(.)、加號(+)、等號(=)和at符號(@)。 |
是 |
響應結果
| 名稱 | 描述 |
|---|---|
| VirtualMFADevices.Base32StringSeed | MFA設備密鑰。 |
| VirtualMFADevices.QRCodePNG | 密鑰二維碼,使用Base64編碼。 |
| VirtualMFADevices.SerialNumber | 唯一標識MFA設備的序列號。 |
請求示例
創建名為mfa1的虛擬MFA設備。
POST?/?HTTP/1.1
Host:?oos-cn-iam.ctyunapi.cn
x-amz-content-sha256:?UNSIGNED-PAYLOAD
Authorization: SignatureValue
X-Amz-Date:?20190315T083028Z
Content-Type:?application/octet-stream
Content-Length:?74
?
Action=CreateVirtualMFADevice&Version=2010-05-08&VirtualMFADeviceName=mfa1
響應示例
HTTP/1.1?200?OK
x-amz-request-id:1a7e651e412c4ecc
Content-Type:text/xml;charset=UTF-8
Content-Length:2746
vary:accept-encoding
Date:Fri,?15?Mar?2019?08:30:30?GMT
Server:?CTYUN
?
<CreateVirtualMFADeviceResponse>
????<CreateVirtualMFADeviceResult>
????????<VirtualMFADevice>
???????????<Base32StringSeed>
?????OBAZWZBY2WENX22KUJUUZVPKZ7OHGXBO23L52ZXHLVYIBNXSJTKAR7AZ5FH5RQLV???????????????</Base32StringSeed>
???????????<QRCodePNG><!--?byte?array?of?png?file?--></QRCodePNG>
?????????<SerialNumber>arn:ctyun:iam::10rc2arpn6306:mfa/mfa1</SerialNumber>
????????</VirtualMFADevice>
????</CreateVirtualMFADeviceResult>
????<ResponseMetadata>
????????<RequestId>1a7e651e412c4ecc</RequestId>
????</ResponseMetadata>
</CreateVirtualMFADeviceResponse>