What you’ll learn:
- How to create a Provider Setup Session to authorize a user
- How to store and reuse Provider Auth Configs
- Advanced patterns (BYO OAuth)
The OAuth Flow
Each user authorizes once. You store their Provider Auth Config ID in your database and reuse it for future sessions. The flow:- Create a Provider Setup Session for the provider
- Redirect your user to the session URL to complete OAuth
- Poll or webhook until the session status is
completed - Store the resulting Provider Auth Config ID for that user
- Pass the auth config ID when creating sessions for that user
Creating a Provider Setup Session
Create a setup session specifying the provider, auth method, and optionally a redirect URL to send the user back to after they authorize.url field—redirect your user to this URL.
Waiting for Completion
| Status | Meaning |
|---|---|
pending | User hasn’t completed the flow yet |
completed | User authorized successfully—auth config is ready |
expired | Session expired before the user completed it |
failed | An error occurred during the flow |
archived | Session was manually deleted |