Skip to content

JWT signing keys in local development yields client failure #4098

@afnan-davia

Description

@afnan-davia

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I migrated my production supabase to JWT signing keys and the Python supabase client works perfectly. However, when I try to set it up locally with signing_keys_path = "./signing_keys.json" in my config.toml I get:

APIError: {'message': 'No suitable key or wrong key type', 'code': 'PGRST301', 'hint': None, 'details': None}

To Reproduce

  1. Create a simple local setup with supabase with signing_keys_path = "./signing_keys.json" in config.toml
  2. Generate signing keys with the following command and save it under the supabase folder in signing_keys.json:
supabase gen signing-key --algorithm ES256
  1. Start the local development platform
  2. Create a Python program with:
from supabase import create_client

supabase = create_client(
    "http://127.0.0.1:54321",
    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU",
)

result = supabase.table("threads").select("*").execute()
  1. See error

If you comment out signing_keys_path = "./signing_keys.json" in config.toml and start supabase again, it will work fine.

Expected behavior

APIResponse[TypeVar](data=[], count=None)

System information

  • OS: macOS
  • Supabase CLI: 2.34.3
  • supabase 2.18.1
  • supabase-auth 2.12.3
  • supabase-functions 0.10.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    authbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions