I am trying to add MFA (Multi Factor Authentication) in my application, where i am going to store object in aws S3 bucket. I went through AWS documentation but could not find anything where we can pass MFA tokedn while sending any request to AWS programmatically in C#.
Here is my working code snippet without MFA,
var awsCredentials = new BasicAWSCredentials(accessKey, secretKey);
_client = new AmazonS3Client(awsCredentials, Amazon.RegionEndpoint.USEast1);
I am trying to add MFA (Multi Factor Authentication) in my application, where i am going to store object in aws S3 bucket. I went through AWS documentation but could not find anything where we can pass MFA tokedn while sending any request to AWS programmatically in C#.
Here is my working code snippet without MFA,
var awsCredentials = new BasicAWSCredentials(accessKey, secretKey); _client = new AmazonS3Client(awsCredentials, Amazon.RegionEndpoint.USEast1);
var putRequest = new PutObjectRequest {
BucketName = ConfigurationManager.AppSettings["S3BucketName"], Key = fileName, FilePath = localFilePath, ContentType = "image/" + Path.GetExtension(fileName), CannedACL = S3CannedACL.PublicRead }; var req = JsonConvert.SerializeObject(putRequest);
I am expecting to add MFA authentication token to this above code.
Thanks,