mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-24 00:22:25 +02:00
Add images
This commit is contained in:
@@ -32,9 +32,14 @@ If everything works, the server should start and open the studio in your browser
|
||||
> This in-memory server is designed for development and testing.
|
||||
> For production use, please use LangGraph Cloud.
|
||||
|
||||
The graph should run, and if you were to self-host this on the public internet, anyone could access it!
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
|
||||
## Adding Authentication
|
||||
|
||||
The [`Auth`](../../cloud/reference/sdk/python_sdk_ref.md#langgraph_sdk.auth.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.
|
||||
@@ -114,7 +119,11 @@ langgraph dev --no-browser
|
||||
}
|
||||
```
|
||||
|
||||
Now let's try to chat with our bot. Run the following code in a file or notebook:
|
||||
Now let's try to chat with our bot. If we've implemented authentication correctly, we should only be able to access the bot if we provide a valid token in the request header. Users will still, however, be able to access each other's resources until we add [resource authorization handlers](../../concepts/auth.md#resource-authorization) in the next section of our tutorial.
|
||||
|
||||

|
||||
|
||||
Run the following code in a file or notebook:
|
||||
|
||||
```python
|
||||
from langgraph_sdk import get_client
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 614 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 545 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 293 KiB |
@@ -8,6 +8,8 @@
|
||||
|
||||
In this tutorial, we will extend our chatbot to give each user their own private conversations. We'll add [resource-level access control](../../concepts/auth.md#resource-level-access-control) so users can only see their own threads.
|
||||
|
||||

|
||||
|
||||
## 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).
|
||||
|
||||
Reference in New Issue
Block a user