CLI - Authorization failed "Forbidden resource"
Hello all!
- A bit of context:
At first I was solo on the project, and configured the database via Supabase dashboard, and the base is on Supabase, not local. Now that we are 2 on it, I want to be able to manage migrations, generate types from the DB etc... and most important, making that each of us can have our own db locally. (We are newbies, we don't want to mess with the data of the other)
Ran into Supabase CLI, and tried to link my project.
- What I did
I installed Supabase Cli & init Supabase:
npx supabase init
Then I generated an access token from the dashboard and logged in using it: (or without the access token, result seems the same)
npx supabase login --token sbp_xxxxxxxxxxx
And got the following message:
You are now logged in. Happy coding!
- What doesn't work (yet)
I then tried to link the supabase project to my local workspace with:
npx supabase link --project-ref "$PROJECT_REF" -p "$SUPABASE_DB_PASSWORD"
(Also tried with the project ref hardwritten, without the db password and typing it after etc) and all I got was that:
Authorization failed for the access token and project ref pair: {"message":"Forbidden resource"}
- Question
What did I do wrong? Is this a bug from supabase or from between the chair and the keyboard?
Thank you to all of you that will take the time to help me!
Hello, Yes I used login, and got the message "You are now logged in. Happy coding!"
I can't find in the docs what could go wrong. I can't link to the project, I can't use migrations. Each time it's a Forbidden Resource message error, I double checked my credentials.
Le dim. 7 janv. 2024 à 20:12, Xquick @.***> a écrit :
Did you supabase login?
— Reply to this email directly, view it on GitHub https://github.com/supabase/cli/issues/1819#issuecomment-1880145390, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX4TOCWEWKHYGV2KSXOYOBTYNLXRLAVCNFSM6AAAAABBPRDGD6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQGE2DKMZZGA . You are receiving this because you authored the thread.Message ID: @.***>
I think we need more context to debug. Could you run supabase link --create-ticket ...? Once you've done that, share the crash id here.
Closing due to staleness.
As a last resort, you can pass in the access token via var. For eg.
SUPABASE_ACCESS_TOKEN=sbp_**** npx supabase@latest link