Python: Auth Admin
- Any method under the
supabase.auth.admin
namespace requires a service_role
key.
- These methods are considered admin methods and should be called on a trusted server. Never expose your
service_role
key in the browser.
Examples
Create server-side auth client
from supabase import create_client
from supabase.lib.client_options import ClientOptions
supabase = create_client(
supabase_url,
service_role_key,
options=ClientOptions(
auto_refresh_token=False,
persist_session=False,
)
)
# Access auth admin api
admin_auth_client = supabase.auth.admin