簡體   English   中英

您可以通過編程方式獲取AWS MFA序列號嗎?

[英]Can you get the AWS MFA serial number programatically?

使用AWS .NET SDK。 我可以使用本地存儲的SDK配置文件查詢AWS。 一些帳戶需要使用交叉帳戶角色進行訪問。 使用SDK承擔角色時,我必須提供MFA序列號。 有什么方法可以使用SDK配置文件從帳戶中獲取序列號嗎?

多虧了helloV,我找到了一些有效的代碼。

AWSCredentials creds = new StoredProfileAWSCredentials(Profile_CBB.Text);
Amazon.IdentityManagement.AmazonIdentityManagementServiceClient imc = new Amazon.IdentityManagement.AmazonIdentityManagementServiceClient(creds);
Amazon.IdentityManagement.Model.ListMFADevicesRequest mfaRequest = new Amazon.IdentityManagement.Model.ListMFADevicesRequest();
Amazon.IdentityManagement.Model.ListMFADevicesResponse mfaResponse = imc.ListMFADevices(mfaRequest);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM