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, 14:30 UTC
docs: add callbackUrl to custom auth config examples
Add callback_url/callbackUrl parameter to all code snippets in the custom auth configs documentation to show users how to redirect back to their application after OAuth completes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Jan 16, 2026 at 16:48 UTC
ea4c7106f8e16c478d6cff2b228811baae6cdc93
1 file changed
+11
-4
fern/pages/src/authentication/custom-auth-configs.mdx
+11
-4
@@ -99,28 +99,34 @@ This auth config is now ready to be used in your application!
99
connection_request = composio.connected_accounts.initiate(
100
user_id="user_id",
101
auth_config_id="ac_1234",
102
+ callback_url="https://yourapp.com/oauth/callback"
103
)
103
-print(connection_request)
104
+
105
+# Redirect the user to connection_request.redirect_url
106
+print(connection_request.redirect_url)
107
108
# Wait for the connection to be established
109
connected_account = connection_request.wait_for_connection()
110
print(connected_account)
111
```
112
```typescript TypeScript maxLines=60
110
-const connReq = await composio.connectedAccounts.initiate(userId, "ac_1234");
113
+const connReq = await composio.connectedAccounts.initiate(userId, "ac_1234", {
114
+ callbackUrl: "https://yourapp.com/oauth/callback",
115
+});
116
117
+// Redirect the user to connReq.redirectUrl
118
console.log(connReq.redirectUrl);
119
120
const connection = await composio.connectedAccounts.waitForConnection(
115
-connReq.id
121
+ connReq.id
122
);
123
124
console.log(connection);
119
-
125
```
126
127
</CodeGroup>
128
129
+
130
### White-labeling the OAuth Consent Screen
131
132
By default the users will see an OAuth screen like the one below:
@@ -173,6 +179,7 @@ def authorize_app(toolkit: str):
179
connection_request = composio.connected_accounts.initiate(
180
user_id=user_id,
181
auth_config_id=auth_config_id,
182
+ callback_url="https://yourapp.com/oauth/callback"
183
)
184
return RedirectResponse(url=connection_request.redirect_url)
185
```