-
Couldn't load subscription status.
- Fork 867
Description
Describe the bug
AmazonS3Client.CreatePresignedPostAsync generates x-amz-credential as:
<AccessKey>/<YYYYMMDD>/<region>/s3/aws4_request/
AWS docs define the scope without a trailing slash. Example: …/aws4_request only. Strict S3-compatible services (like Minio) reject the extra / during SigV4 parsing.
AWS Documentation POST
Code reference
File: sdk/src/Services/S3/Custom/Util/S3PostUploadSignedPolicy.cs S3PostUploadSignedPolicy.cs
Line 123:
var credentialString = string.Format(CultureInfo.InvariantCulture, "{0}/{1}/{2}/{3}/{4}/", iCreds.AccessKey, dateStamp, region, "s3", Runtime.Internal.Auth.AWS4Signer.Terminator); Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
x-amz-credential follows AWS SigV4 scope format: YYYYMMDD/region/service/aws4_request (no trailing slash).
aws reference_sigv-signing-elements
Current Behavior
x-amz-credential includes a trailing slash.
Reproduction Steps
- Build a
CreatePresignedPostRequestand callCreatePresignedPostAsync. - POST the returned form to a SigV4-strict S3-compatible server.
- Receive
AuthorizationQueryParametersErrorabout date parsing. Logged fields showx-amz-credentialends with/.
Possible Solution
Emit x-amz-credential without the trailing slash, or provide an option to do so, to match AWS documentation and improve interoperability.
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.S3 4.0.7.13
Targeted .NET Platform
.Net Core 9
Operating System and version
Windows 11