-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Third party auth not working with Storage #3362
Comments
I am having a similar issue, which I had posted (along with another issue today) the following: I'm setting up local development using Setup:
Problem:
Key Observation:
Has anyone seen this behavior where the Thanks! |
Also adding that I am seeing this issue on local development. I only see it when trying to do anything with storage, normal tables within the public schema seem to work correctly. When tested with a live cloud version of supabase, it works correctly. |
Describe the bug
I've searched issues, discussions and discord.
I'm trying to use a Cognito JWT with Supabase. I've followed the documentation to integrate with Cognito.
Fetching from Supabase database works fine using the JWT. But trying to get private files from Storage fails with the error 'invalid algorithm'.
I'm running it locally.
I've checked the source code and I wonder if there is a bug with the environment variables, I wanted to double check here if someone has successfully gotten it to work.
I suspect there is a mismatch between the environment variables that the supabase cli creates (see here, notice AUTH_JWT_ALGORITHM is also not set) and what Storage expects (see here)
I tested the JWT against the cloud Supabase Storage and it seems to work, so it looks like a bug in Supabase CLI.
To Reproduce
Configure Supabase to use Cognito for auth
config.toml
Send a POST request to sign an image with the JWT token in the Auth Bearer header:
http://127.0.0.1:54321/storage/v1/object/sign/bucket/image.jpeg
I get an invalid algorithm error
From looking at the code (see links above), I think that the issue is caused by the Storage docker container not getting the right environment variables. I've tested this in the cloud version of Supabase and I suspect it works (I get a 404 because I haven't fixed the policies, but it goes past the JWT check).
Again, fetching data from the Supabase Database works with my JWT, so I know its valid.
Expected behavior
Once configuring Cognito as third party auth, I'd expect Storage to accept its JWT.
Screenshots
N/A
System information
No specific command fails but this is my system info
Additional context
The text was updated successfully, but these errors were encountered: