You Already Have OAuth. Now What?
If you use Auth0, Clerk, Firebase Auth, or your own OAuth server, you don’t need to build a new one. You just point ATH’s config at your existing endpoints.The One Config Change
In yourcreateATHHandlers config, the oauth section tells ATH where to send users for consent:
What ATH Does With Your OAuth
In short:- ATH builds a redirect URL to your OAuth authorize endpoint (with PKCE)
- Your OAuth server shows the consent screen to the user
- After consent, your OAuth server redirects to
/ath/callbackwith an authorization code - ATH exchanges that code at your token endpoint (server-side, with PKCE verifier)
- ATH stores the resulting token internally — the agent never sees it
Setup Per Provider
- Auth0
- Clerk
- Custom OAuth
- Create a “Regular Web Application” in Auth0 dashboard
- Set Allowed Callback URL to
https://your-app.com/ath/callback - Note the Client ID and Client Secret
- Use these in your ATH config:
Requirements for Your OAuth Server
ATH needs your OAuth server to support:| Feature | Required? | Why |
|---|---|---|
| Authorization Code grant | ✅ | Core flow |
| PKCE (S256) | ✅ | Security — prevents code interception |
| Custom scopes | Recommended | So users see meaningful permissions on consent screen |
| Token endpoint returns JSON | ✅ | ATH parses the response |
What if My OAuth Doesn’t Support PKCE?
Older OAuth servers might not support PKCE. In that case, you have two options:- Upgrade your OAuth server — most have PKCE support as a toggle
- Use the ATH Gateway instead — put a gateway in front of your service, and the gateway handles PKCE with its own OAuth client. See Set Up a Gateway.