How OAuth Works
- Authorization Request: Your app redirects users to Gumnut’s authorization page
- User Consent: Users approve the requested permissions (scopes)
- Authorization Code: Gumnut redirects back with an authorization code
- Token Exchange: Your app exchanges the code for access tokens
- API Access: Use the access token to make authorized requests
OAuth Endpoints
- Authorization:
https://api.gumnut.ai/oauth/authorize - Token:
https://api.gumnut.ai/oauth/token - Token Revocation:
https://api.gumnut.ai/oauth/revoke
OAuth Metadata
Protected Resource Metadata is available at:/.well-known/oauth-protected-resource/mcp(RFC 9728)
Authorization Code Flow with PKCE
PKCE (Proof Key for Code Exchange) is the recommended flow for all clients:Confidential server-side applications may also include
client_secret in the token exchange request.Scopes
Control access with granular scopes:Using OAuth Tokens
Once obtained, use OAuth tokens as Bearer tokens:Token Lifecycle
Refreshing Tokens
Integration Examples
Python with OAuth
React
Troubleshooting
OAuth Redirect Issues
- Verify redirect URI matches exactly (including trailing slashes)
- Ensure redirect URI is whitelisted in your OAuth app settings
- Check for URL encoding issues
Token Expiration
- Implement token refresh logic
- Monitor token expiry times
- Handle 401 responses gracefully with retry logic
CORS Issues (Browser)
- OAuth tokens work in browsers with proper CORS headers
- API keys should not be used in client-side code
- Use a backend proxy for API key authentication