diff --git a/docs/docs/concepts/auth.md b/docs/docs/concepts/auth.md index 993cf8a92..eae18ba01 100644 --- a/docs/docs/concepts/auth.md +++ b/docs/docs/concepts/auth.md @@ -17,6 +17,22 @@ While often used interchangeably, these terms represent distinct security concep In LangGraph Platform, authentication is handled by your [`@auth.authenticate`](../cloud/reference/sdk/python_sdk_ref.md#langgraph_sdk.auth.Auth.authenticate) handler, and authorization is handled by your [`@auth.on`](../cloud/reference/sdk/python_sdk_ref.md#langgraph_sdk.auth.Auth.on) handlers. +## Default Security Models + +LangGraph Platform provides different security defaults: + +### LangGraph Cloud + +- Uses LangSmith API keys by default +- Requires valid API key in `x-api-key` header +- Can be customized with your auth handler + +### Self-Hosted + +- No default authentication +- Complete flexibility to implement your security model +- You control all aspects of authentication and authorization + ## System Architecture A typical authentication setup involves three main components: @@ -402,21 +418,6 @@ Here are all the supported action handlers: Runs are scoped to their parent thread for access control. This means permissions are typically inherited from the thread, reflecting the conversational nature of the data model. All run operations (reading, listing) except creation are controlled by the thread's handlers. There is a specific `create_run` handler for creating new runs because it had more arguments that you can view in the handler. -## Default Security Models - -LangGraph Platform provides different security defaults: - -### LangGraph Cloud - -- Uses LangSmith API keys by default -- Requires valid API key in `x-api-key` header -- Can be customized with your auth handler - -### Self-Hosted - -- No default authentication -- Complete flexibility to implement your security model -- You control all aspects of authentication and authorization ## Next Steps diff --git a/docs/docs/tutorials/auth/getting_started.md b/docs/docs/tutorials/auth/getting_started.md index 0f8a79bae..02fce1c58 100644 --- a/docs/docs/tutorials/auth/getting_started.md +++ b/docs/docs/tutorials/auth/getting_started.md @@ -5,6 +5,7 @@ 1. Basic Authentication (you are here) - Control who can access your bot 2. [Resource Authorization](resource_auth.md) - Let users have private conversations 3. [Production Auth](add_auth_server.md) - Add real user accounts and validate using OAuth2 + !!! tip "Prerequisites" This guide assumes basic familiarity with the following concepts: @@ -46,8 +47,12 @@ The graph should run, and if you were to self-host this on the public internet, ![No auth](./img/no_auth.png) -Now that we've seen the base LangGraph app, let's add authentication to it! In part 1, we will start with a hard-coded token for illustration purposes. -We will get to a "production-ready" authentication scheme in part 3, after mastering the basics. +Now that we've seen the base LangGraph app, let's add authentication to it! + +???+ tip "Placeholder token" + + In part 1, we will start with a hard-coded token for illustration purposes. + We will get to a "production-ready" authentication scheme in part 3, after mastering the basics. ## Adding Authentication diff --git a/docs/docs/tutorials/auth/resource_auth.md b/docs/docs/tutorials/auth/resource_auth.md index ae1d08da4..46494e4ff 100644 --- a/docs/docs/tutorials/auth/resource_auth.md +++ b/docs/docs/tutorials/auth/resource_auth.md @@ -10,6 +10,11 @@ In this tutorial, we will extend our chatbot to give each user their own private ![Authorization handlers](./img/authorization.png) +???+ tip "Placeholder token" + + As we did in [part 1](getting_started.md), for this section, we will use a hard-coded token for illustration purposes. + We will get to a "production-ready" authentication scheme in part 3, after mastering the basics. + ## Understanding Resource Authorization In the last tutorial, we controlled who could access our bot. But right now, any authenticated user can see everyone else's conversations! Let's fix that by adding [resource authorization](../../concepts/auth.md#resource-authorization).