Supabase cli to accept oauth tokens #28686
Unanswered
tgirotto
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment it's possible to create third-party apps via oauth in supabase. However, the access token that's obtained in the oauth process cannot be used in the cli via
npx supabase login --token <token>, which only accepts personal access tokens created in the dashboard. As a result, most of the functionality available in the cli is not accessible to oauth apps.The supabase backend seems to already accept oauth tokens, but the cli regex check does not. In https://github.com/supabase/cli/blob/02260aef950c59536af3fc8efc03df01621e7475/internal/utils/access_token.go#L15 the regex expression
^sbp_[a-f0-9]{40}$can be changed to
^sbp_(?:oauth_)?[a-f0-9]{40}$and the cli functionality can be opened up to oauth apps.Example can be found at https://www.npmjs.com/package/supabase-cli-oauth:
npx supabase-cli-oauth login --token sbp_oauth_0fb....697, where the access_token is obtained through the oauth flow.Beta Was this translation helpful? Give feedback.
All reactions