Auth
object and resource-level access control, but upgrade authentication to use Supabase as your identity provider. While Supabase is used in this tutorial, the concepts apply to any OAuth2 provider. You’ll learn how to:
custom-auth
directory and ensure you have the langgraph-cli
installed:
.env
file.env
file:Auth
object to validate hard-coded tokens and add resource ownership.
Now you’ll upgrade your authentication to validate real JWT tokens from Supabase. The main changes will all be in the @auth.authenticate
decorated function:
src/security/auth.py
to implement this:
/login
requests until after you have confirmed your users’ email.
Now test that users can only see their own data. Make sure the server is running (run langgraph dev
) before proceeding. The following snippet requires the “anon public” key that you copied from the Supabase dashboard while setting up the auth provider previously.