I’ve been struggling with this one and can’t seem to figure out why it is failing. I can run Get/List/Put requests successfully in Unity editor however on my phone and in the Xcode simulator only Get/List work. the Put requests fails with the following error message:
Error: Amazon.S3.AmazonS3Exception: The request signature we calculated does not match the signature you provided. Check your key and signing method. —> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type ‘Amazon.Runtime.Internal.HttpErrorResponseException’ was thrown.
this is the content of the response:
Received error response: [<?xml version="1.0" encoding="UTF-8"?>
SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.XXXXXXXXXXXXAWS4-HMAC-SHA25620180107T032858Z20180107/us-east-1/s3/aws4_request19d036f4270664926f898506ae82bb40350439046a401c0ecae6facab5af423d</StringToSignde0f14b4426a411b60830c44c2eaa2cb185e28f16f04c04969c62c08ed6a709c41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 31 38 30 31 30 37 54 30 33 32 38 35 38 5a 0a 32 30 31 38 30 31 30 37 2f 75 73 2d 65 61 73 74 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 31 39 64 30 33 36 66 34 32 37 30 36 36 34 39 32 36 66 38 39 38 35 30 36 61 65 38 32 62 62 34 30 33 35 30 34 33 39 30 34 36 61 34 30 31 63 30 65 63 61 65 36 66 61 63 61 62 35 61 66 34 32 33 64PUT/0001
the code:
void Awake() {
UnityInitializer.AttachToGameObject(this.gameObject);
AWSConfigs.HttpClient = AWSConfigs.HttpClientOption.UnityWebRequest;
AWSConfigs.CorrectForClockSkew = true;
AWSConfigs.RegionEndpoint = RegionEndpoint.USEast1;
AWSConfigs.LoggingConfig.LogTo = LoggingOptions.UnityLogger;
AWSConfigs.LoggingConfig.LogResponses = ResponseLoggingOption.Always;
AWSConfigs.LoggingConfig.LogMetrics = true;
IAmazonS3 client = new AmazonS3Client(AccessKey, SecretKey, RegionEndpoint.USEast1);
}
void SubmitPlayerData(string fileName)
{
FileStream stream = null;
try
{
stream = new FileStream(sUserDataPath, FileMode.Open, FileAccess.Read, FileShare.Read);
var request = new PutObjectRequest()
{
BucketName = BucketName,
Key = fileName,
InputStream = stream,
CannedACL = S3CannedACL.Private,
};
client.PutObjectAsync(request, (responseObject) =>
{
if (responseObject.Exception == null)
{
UnityEngine.Debug.Log(“successfully uploaded file.”);
}
else
{
UnityEngine.Debug.Log("Error: " + responseObject.Exception);
}
stream.Close();
});
}
catch (Exception ex)
{
UnityEngine.Debug.Log(string.Format(“Error Msg: {0}\nStackTrace: {1}.”, ex.Message, ex.StackTrace));
}
stream.Close();
}
}
Link.xml file: (/assets/link.xml
================================================================
awsconfig.xml (located in /Assets/Resources/awsconfig.xml)
<?xml version="1.0" encoding="utf-8"?> ================================================================I’ve confirmed the user has all permissions required. The Access Key & Secret Access Key for said user have been reset and re-etentered.
The bucket is made for the right region.
I even changed the bucket permissions to open access to see if it was that.
I tried initialising the s3client the way it was done in the documentation examples:
client = new AmazonS3Client(credentials, RegionEndpoint.USEast1);
this also didn’t help.
I also tried the root user credentials to no avail.
I downloaded the latest updates of the SDKs and updated them, still no joy.
I’m truly at a loss here, any assistance would be greatly appreciated.
I’m hoping there is something I’m missing