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

ListAccessKeys() 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 ListAccessKeys ( ) : ListAccessKeysResponse
return ListAccessKeysResponse
        public ListAccessKeysResponse ListAccessKeys()
        {
            return ListAccessKeys(new ListAccessKeysRequest());
        }

Same methods

AmazonIdentityManagementServiceClient::ListAccessKeys ( ListAccessKeysRequest request ) : ListAccessKeysResponse

Usage Example

Example #1
0
 public static void DeleteAccessKeysForUser(AmazonIdentityManagementServiceClient client, string username)
 {
     ListAccessKeysResponse response = client.ListAccessKeys(new ListAccessKeysRequest() { UserName = username });
     foreach (AccessKeyMetadata akm in response.AccessKeyMetadata)
     {
         client.DeleteAccessKey(new DeleteAccessKeyRequest() { UserName = username, AccessKeyId = akm.AccessKeyId });
     }
 }
All Usage Examples Of Amazon.IdentityManagement.AmazonIdentityManagementServiceClient::ListAccessKeys
AmazonIdentityManagementServiceClient