What you’ll learn:
- How OAuth works with Metorial
- Creating Provider Setup Sessions
- Storing and reusing Provider Auth Configs
How OAuth Works
The OAuth flow uses Provider Setup Sessions:- Create a Provider Setup Session for the provider the user needs to authorize
- Redirect the user to the session URL to complete OAuth in their browser
- Wait for completion — returns the completed setup session with an auth config
- Store the Provider Auth Config ID for that user in your database
- Pass the auth config ID when creating sessions for that user
Creating Provider Setup Sessions
Waiting for Completion
Using Auth Configs in Sessions
Retrieve the stored auth config ID from your database and pass it when creating a session:Multiple OAuth Services
You can combine multiple OAuth-enabled providers in a single session:Complete Example
What’s Next?
Provider Examples
See how to use OAuth with different AI providers.
OAuth Integrations
Learn about OAuth-enabled integrations in the catalog.