Auth
object lets you register an authentication function that the LangGraph platform will run on every request. This function receives each request and decides whether to accept or reject.
Create a new file src/security/auth.py
. This is where your code will live to check if users are allowed to access your bot:
langgraph.json
configuration:
--no-browser
, the studio UI will open in the browser. You may wonder, how is the studio able to still connect to our server? By default, we also permit access from the LangGraph studio, even when using custom auth. This makes it easier to develop and test your bot in the studio. You can remove this alternative authentication option by setting disable_studio_auth: "true"
in your auth configuration: