SignatureDoesNotMatch trying to access SB S3, using authenticated users session token
I'm trying to access SB S3 via an authenticaed users session token, using the approach outlined here: https://supabase.com/docs/guides/storage/s3/authentication#session-token
I've verified that I can upload to a specific bucket using a normal accesskey/secret - but I'd prefer to use the users own credentials (JWT) instead of embedding secrets into the browser side.
However; I am seeing a SignatureDoesNotMatch being thrown. In the logs:
So I believe I'm calling it OK. My S3 config setup is:
I am using the latest S3 library, in a vite/react project. Is there something I'm missing?
2 Replies
The error is saying the session token you are providing is not a valid JWT, so you need to make sure you are passing a valid JWT.
It is valid. Turns out tho that I needed to pass the 'anonymous' (anon) key from my project. (Project Settings | API Keys | Legacy API Keys). That wasn't entirely clear to me, as I've only been using sb about 2wks tops.