Upload from serverside .NET to supabase storage
Hey! Trying to upload an image through a .NET API using supabase storage and AWS s3 package. Im getting this error. Any idea what to do? "The AWS Access Key Id you provided does not exist in our records"
Been going mad testing settings in the setup but still get this error. API keys are valid and brand new, buckets exist.
8 Replies
Did you generate access key and secret from this page https://supabase.com/dashboard/project/_/settings/storage
Yes! Also tried a couple of new ones. Made sure theres no spaces in there also. Not sure if its any setup needed in the code?
var credentials = new BasicAWSCredentials(options.AccessKey, options.SecretKey);
var config = new AmazonS3Config
{
ServiceURL = options.ServiceUrl,
RegionEndpoint = RegionEndpoint.EUNorth1,
SignatureVersion = "4",
ForcePathStyle = true // Required for Supabase Storage
};
return new AmazonS3Client(credentials, config);
Tested around a bit iwth the config - setting signatureversion and also switching regionendpoint to AuthenticationRegion = "eu-north-1",
I'm guessing you're using the default endpoint used by aws, but you have to use the supabase endpoint

Absolutely I set the serviceURL= : https://ioixxx.supabase.co/storage/v1/s3
[11:46:35 INF] ServiceUrl from config: https://xxx.supabase.co/storage/v1/s3
Logging everything the settings do look correct
I've never used .net framework but this works for me in nodejs
package:
"@aws-sdk/client-s3": "^3.845.0"
Perfect, i'll test that! Thanks (Y)
Works just fine using Node instead 😕
Well that sucks 🙂 Using .NET for the backend. So guess I'll have to write a http client instead of using the aws-packages
Yeah definitely some config. Almost looks the request is going to the real AWS S3. Been changing every property of the config back and forth. Guessing there is some magic one that needs to fit 😕