There is some way to generate presigned url for Cloud object storage in ibm cloud?
I tested with examples using java and it generates a url that works, and it generate query params like X-Amz-Algorith...
But when I try do the same using .NET, first, I have to use aws sdk for S3, to manage, and I can do operations like upload/download, but the generatedpresigned url method generates me an url with different query params and if I try use that for download (for example) It does not work (always I get 403 - Forbidden).
Values of query params that generates when I create the presigned url using .NET AWS S3 nuget contains following params:
- AWSAccessKeyId=<>
- Expires=<>
- Signature=<>
But using Java and com.ibm.cloud.objectstorage.services.s3.model, I recover query params like:
- X-Amz-Algorithm
- X-Amz-Date
- X-Amz-SignedHeaders
- X-Amz-Expires
- X-Amz-Credential -> it is different that the accesskey of the .net solution (contains metainformation readable in the string)
- X-Amz-Signature -> it is different (in lenght)
Need to know:
- if there is a solution for .NET core
- special package
- api rest way
- etc
- if I could "map" one url to do similar than the correct one if maybe parameters could be equivalent.
This suggests that you are using SigV2 instead of SigV4. SigV2 uses query parameters like
Expireswhereas SigV4 and SigV4A usesX-Amz-Expires.You are probably configured to use
us-east-1which the AWS .NET SDK treats as the regional endpoint and therefore uses SigV2 by default.Try setting your region explicitly directly in the client or set the signature version explicitly via the
AWSConfigsS3object.Setting the region explicitly:
forcing SigV4 if you must use us-east-1 via config:
If you really want to know why the AWS .NET SDK uses SigV2 for us-east-1, here is the explanation from a principal engineer on the aws .NET SDK: