You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/langsmith/set-up-custom-auth.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ Now that you have a base LangGraph app, add authentication to it.
78
78
In this tutorial, you will start with a hard-coded token for example purposes. You will get to a "production-ready" authentication scheme in the third tutorial.
79
79
</Note>
80
80
81
-
The [`Auth`](https://langchain-ai.github.io/langgraph/cloud/reference/sdk/python-sdk_ref#langgraph_sdk.auth.Auth) object lets you register an authentication function that the LangSmith deployment will run on every request. This function receives each request and decides whether to accept or reject.
81
+
The @[Auth] object lets you register an authentication function that the LangSmith deployment will run on every request. This function receives each request and decides whether to accept or reject.
82
82
83
83
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:
Notice that your [authentication](https://langchain-ai.github.io/langgraph/cloud/reference/sdk/python-sdk_ref#langgraph_sdk.auth.Auth.authenticate) handler does two important things:
117
+
Notice that your @[Auth.authenticate] handler does two important things:
118
118
119
119
1. Checks if a valid token is provided in the request's [Authorization header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization)
120
-
2. Returns the user's [identity](https://langchain-ai.github.io/langgraph/cloud/reference/sdk/python-sdk_ref#langgraph_sdk.auth.types.MinimalUserDict)
120
+
2. Returns the user's @[MinimalUserDict]
121
121
122
-
Now tell LangGraph to use authentication by adding the following to the [`langgraph.json`](/langsmith/cli#configuration-file) configuration:
122
+
Now tell LangGraph to use authentication by adding the following to the @[langgraph.json] configuration:
123
123
124
124
```json {highlight={7-9}} title="langgraph.json"
125
125
{
@@ -203,4 +203,4 @@ Now that you can control who accesses your bot, you might want to:
203
203
204
204
1. Continue the tutorial by going to [Make conversations private](/langsmith/resource-auth) to learn about resource authorization.
205
205
2. Read more about [authentication concepts](/langsmith/auth).
206
-
3. Check out the [API reference](https://langchain-ai.github.io/langgraph/cloud/reference/sdk/python-sdk_ref) for more authentication details.
206
+
3. Check out the API reference for @[Auth], @[Auth.authenticate], and @[MinimalUserDict] for more authentication details.
0 commit comments