composio.authConfigs.create() returns an auth config ID like ac_xxxxxxxx. Store that ID, then pass it to a session so the session authenticates with it.
Composio managed auth
For OAuth2 toolkits, Composio maintains a managed app so you can create an auth config without bringing your own credentials. This is the fastest way to start.- Python
- TypeScript
- API
Your own OAuth2 credentials
Bring your own OAuth app to show your branding on consent screens, request custom scopes, or get a dedicated rate-limit quota. Register the app in the provider’s developer portal, set its authorized redirect URI to Composio’s callback, then pass the client ID and secret.- Python
- TypeScript
- API
Set
oauth_redirect_uri to the exact URL registered in your provider’s OAuth app. Some toolkit defaults still use the supported legacy endpoint https://backend.composio.dev/api/v1/auth-apps/add. If you omit oauth_redirect_uri, register the toolkit’s default URL with your provider. When you route the callback through your own domain, set your custom URL in both places.Other auth types
Toolkits that use API keys, bearer tokens, basic auth, or no auth follow the same call. Setauth_scheme to the toolkit’s scheme and put the required fields in credentials. For a toolkit whose key the user supplies at connect time, pass empty credentials.
- Python
- TypeScript
- API
Use the auth config in a session
Creating an auth config does not change which credentials a session uses. Pass the auth config ID toauthConfigs (keyed by toolkit) when you create the session, and the session authenticates that toolkit with your config. Toolkits you leave out keep using Composio managed auth.
- Python
- TypeScript
- API
authConfigs interacts with account selection and precedence.
Find auth configs
You can fetch up to 200 auth configs per request. Setlimit to 200 when listing auth configs to retrieve up to that many at once. Paginate through the results if you have more than 200 matching configs.
Filter auth configs by name or ID with search in either SDK or the API. Disabled configs are excluded by default; set showDisabled (show_disabled in Python) to include them. Auth config responses use id as their canonical identifier.
- Python
- TypeScript
- API
Discover the required fields
Different schemes need different credential fields. To build thecredentials object dynamically, ask the toolkit which fields it requires for a given scheme before you create the config.
- Python
- TypeScript
- API