© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•5mo ago•
25 replies
John

Supabase Local With Supabase-py & Secret Key Not Working (Expected 3 parts in JWT; got 1)

I'm using supabase-py version
2.20.0
2.20.0
and trying to create a client with:

url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_SECRET_KEY")

print(url, key) # This prints the values as expected.

supabase: Client = create_client(url, key)

response = (
   supabase.table("user_profile")
   .select("*")
   .execute()
)
url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_SECRET_KEY")

print(url, key) # This prints the values as expected.

supabase: Client = create_client(url, key)

response = (
   supabase.table("user_profile")
   .select("*")
   .execute()
)


SUPABASE_URL
SUPABASE_URL
is the
API URL
API URL
from
supabase status
supabase status
and
SUPABASE_SECRET_KEY
SUPABASE_SECRET_KEY
is the
Secret key
Secret key
from
supabase status
supabase status
.

When running any kind of query, I'm getting I'm error of
Expected 3 parts in JWT; got 1
Expected 3 parts in JWT; got 1
.

I found this issue that looks related but it looks like it was fixed https://github.com/supabase/supabase-py/issues/1183.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How can I get JWT secret in local instance of supabase?
SupabaseSSupabase / help-and-questions
4y ago
How to access JWT private key/shared secret in Supabase Admin UI
SupabaseSSupabase / help-and-questions
3mo ago
Supabase Local - API Key?
SupabaseSSupabase / help-and-questions
3y ago
Local PostgREST returns PGRST301 (Invalid JWT parts) when createClient sb_secret/sb_publish
SupabaseSSupabase / help-and-questions
5mo ago