Click here to Skip to main content
15,911,646 members

Comments by RakeshAlajipur (Top 2 by date)

RakeshAlajipur 27-Mar-19 3:19am View    
Hi David, Thanks for response. The shared links contains CLI, actually i wanted to do from server side to save the images in S3 bucket with MFA.

I have tried with GetSessionToken() method, from this i am getting sessionToken credentials which iam passing as paremeter while creating AmazonS3Client object, this object am using to upload image to S3 bucket. Please refer my below code here, Please advice if this code is sufficient enough to pass MFA programmatically.

var client = new AmazonSecurityTokenServiceClient(new BasicAWSCredentials("AK", "SK"),Amazon.RegionEndpoint.USEast1);

var sessionTokenResult = client.GetSessionToken(); Credentials sessionCredentials = sessionTokenResult.Credentials; AmazonS3Client s3Client = new AmazonS3Client(sessionCredentials, Amazon.RegionEndpoint.USEast1);

var putRequest = new PutObjectRequest { //Parameters };
var response = s3Client.PutObject(putRequest)
RakeshAlajipur 26-Mar-19 5:58am View    
Hi, I have tried using above code by enabling the MFA in console, but through code how to send MFA authentication key using C#, as am getting access error while running the above code.