Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 17:00 UTC
authenticaitn update
Sushmithamallesh committed
Dec 10, 2025 at 18:19 UTC
c9f7270802b9c783c7a7abdd37b85b7640e8b27b
1 file changed
+30
-4
fern/pages/src/tool-router/authentication.mdx
+30
-4
@@ -10,15 +10,41 @@ Tool Router handles authentication through [Connect Links](/docs/authenticating-
10
11
## In-chat authentication
12
13
-By default, when a tool requires authentication, the agent prompts the user with a Connect Link. The user authenticates and confirms in chat.
13
+By default, when a tool requires authentication, the agent prompts the user with a Connect Link. The user authenticates and confirms in chat. The agent handles OAuth flows, token refresh, and credential management automatically.
14
+
15
+Here's what this looks like in a conversation:
16
+
17
+```
18
+You: Star the composio repo on GitHub
19
+
20
+Agent: I need you to connect your GitHub account first.
21
+ Please click here to authorize: https://connect.composio.dev/link/ln_abc123
22
+
23
+You: Done
24
+
25
+Agent: Done! I've starred ComposioHQ/composio.
26
+```
27
28
This flow works well for chat applications where users interact directly with the agent. See [Using in-chat authentication](/tool-router/using-in-chat-authentication).
29
30
## Manual authentication
31
19
-For apps that manage auth outside of chat, use `session.authorize()` to generate Connect Links programmatically.
20
-
21
-Use this when you want users to connect accounts during onboarding, or when building a custom connections page. See [Manually authenticating users](/tool-router/manually-authenticating-users).
32
+For apps that manage auth outside of chat, use `session.authorize()` to generate Connect Links programmatically:
33
+
34
+<CodeGroup>
35
+```python
36
+connection_request = session.authorize("github")
37
+print(connection_request.redirect_url)
38
+# https://connect.composio.dev/link/ln_abc123
39
+```
40
+```typescript
41
+const connectionRequest = await session.authorize("github");
42
+console.log(connectionRequest.redirectUrl);
43
+// https://connect.composio.dev/link/ln_abc123
44
+```
45
+</CodeGroup>
46
+
47
+Use this when you want users to connect accounts during onboarding, or when building a custom connections page. See [Manually authenticating users](/tool-router/manually-authenticating-users) for a detailed guide.
48
49
## How Tool Router manages auth configs
50