Amazon Simple Storage Service
Developer Guide (API Version 2006-03-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Making Requests Using AWS Account or IAM User Credentials - AWS SDK for .NET

The following tasks guide you through using the .NET classes to send authenticated requests using your AWS account or IAM user credentials.

Making Requests Using Your AWS Account or IAM user Credentials

1

Create an instance of the AmazonS3Client class by providing your AWS Account or IAM user credentials (Access Key ID, Secret Access Key).

2

Execute one of the AmazonS3Client methods to send requests to Amazon S3. The client generates the necessary signature from your credentials and includes it in the request it sends to Amazon S3.


The following C# code sample demonstrates the preceding tasks.

BasicAWSCredentials basicCredentials = 
               new BasicAWSCredentials("*** Access Key ID ***", 
                                       "*** Security Access Key ***");
AmazonS3Client s3Client = new AmazonS3Client(basicCredentials);

// Send sample request (for example, list buckets).             
var response = s3Client.ListBuckets();

[Note]Note

You can create the AmazonS3Client client without providing your security credentials. Requests sent using this client are anonymous requests, without a signature. Amazon S3 returns an error if you send anonymous requests for a resource that is not publicly available.

For working examples, see Working with Amazon S3 Objects and Working with Amazon S3 Buckets. You can test these examples using your AWS Account or an IAM user credentials.

For example, to list all the object keys in your bucket, see Listing Keys Using the AWS SDK for .NET.