Amazon.IdentityManagement.AmazonIdentityManagementServiceClient.ListAccessKeysAsync C# (CSharp) Method

ListAccessKeysAsync() public method

Returns information about the access key IDs associated with the specified IAM user. If there are none, the action returns an empty list.

Although each user is limited to a small number of keys, you can still paginate the results using the MaxItems and Marker parameters.

If the UserName field is not specified, the UserName is determined implicitly based on the AWS access key ID used to sign the request. Because this action works for access keys under the AWS account, you can use this action to manage root credentials even if the AWS account has no associated users.

To ensure the security of your AWS account, the secret access key is accessible only during key and user creation.

/// The request was rejected because it referenced an entity that does not exist. The /// error message describes the entity. /// /// The request processing has failed because of an unknown error, exception or failure. ///
public ListAccessKeysAsync ( System cancellationToken = default(CancellationToken) ) : Task
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
        public Task<ListAccessKeysResponse> ListAccessKeysAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            return ListAccessKeysAsync(new ListAccessKeysRequest(), cancellationToken);
        }

Same methods

AmazonIdentityManagementServiceClient::ListAccessKeysAsync ( ListAccessKeysRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonIdentityManagementServiceClient::ListAccessKeysAsync ( ListAccessKeysResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
AmazonIdentityManagementServiceClient::ListAccessKeysAsync ( ListAccessKeysRequest request, ListAccessKeysResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

コード例 #1
0
ファイル: Util.cs プロジェクト: rajdotnet/aws-sdk-net
 public static void DeleteAccessKeysForUser(AmazonIdentityManagementServiceClient client, string username)
 {
     ListAccessKeysResponse response = client.ListAccessKeysAsync(new ListAccessKeysRequest() { UserName = username }).Result;
     foreach (AccessKeyMetadata akm in response.AccessKeyMetadata)
     {
         client.DeleteAccessKeyAsync(new DeleteAccessKeyRequest() { UserName = username, AccessKeyId = akm.AccessKeyId }).Wait();
     }
 }
AmazonIdentityManagementServiceClient