π§βπ€βπ§ Authentication
Manage all the connected accounts of your Users
Introduction to Entities
- Each unique user is represented by a unique entity id.
- If you have two users, Jessica and Melissa, they will have unique entity ids.
Introduction to Connected Accounts
- When a user connects their account, a
connected_account
object is created. - This object securely stores authentication data such as access tokens and refresh tokens.
π Master Authentication in Minutes!
Authentication Made Simple
Unlock the full potential of Composioβs secure authentication system - Perfect for both beginners and advanced users.
Connecting an Account for your User
Connecting a user account requires a few API calls to authenticate and authorize access. The process involves:
- Fetch Required Parameters - Get the authentication requirements for the chosen application
- Collect User Input - Gather the required parameters from your user interface
- Create Connection - Initialize a new connection with the collected parameters
- Handle OAuth Flow - For OAuth applications, redirect the user to complete authorization
- Verify Status - Check that the connection was successful
The code snippets below demonstrate how to implement this flow in your application.
Collect Parameters Required to create a Connection
To create a connected account for your user:
- Fetch required auth parameters for the application
- Collect these parameters from the user
- Initiate a new connection request
api_key
Collect the required parameters from your user through your preferred interface (UI, chat, or API).
All parameters should be provided as strings.
Try creating a connection with the parameters collected
In the code snippets below replace redirect_url
Some applications require user redirection to complete the authentication process. Gmail for example requires redirecting the user to Googleβs login page.
Fetch the Connection Params (Status, Access Token, Refresh Token...)
If you want to use connection params locally and build custom actions -
Connection status can be failed
, initiated
or active
.
Example of how connection params would look like
You can fetch connection details after user is redirected back to your app. (If redirect was needed)
connection_status
& connectedAccountId
will be available in the query params.
Get All Connected accounts
Hereβs your modified documentation with three tabs (Python, JavaScript, and API), each containing relevant steps and code snippets:
Execute Agent and Perform Tasks on Behalf of an Entity
Examples of Authentication Flows
OAuth Authentication
Learn how to implement OAuth authentication in your application
API Key Authentication
Learn how to implement API Key authentication in your application
Was this page helpful?