OAuth Troubleshooting
Common OAuth connection issues
OAuth Troubleshooting
Section titled “OAuth Troubleshooting”Connection Not Working
Section titled “Connection Not Working”Check 1: OAuth Connection Configured
Section titled “Check 1: OAuth Connection Configured”Verify the OAuth connection exists:
- Go to Settings → OAuth Connections
- Check that the connection shows as “Connected”
Check 2: Token Expired
Section titled “Check 2: Token Expired”Bifrost automatically refreshes tokens, but if the refresh token has expired:
- Delete the existing OAuth connection
- Re-authorize to get a fresh token
Check 3: Scopes Correct
Section titled “Check 3: Scopes Correct”Ensure the OAuth app has the required scopes/permissions for your API calls.
Using OAuth in Workflows
Section titled “Using OAuth in Workflows”from bifrost import workflow, oauthimport aiohttp
@workflowasync def call_graph_api(): """Example Microsoft Graph API call.""" conn = await oauth.get("microsoft") if not conn: return {"error": "Microsoft OAuth not configured"}
headers = {"Authorization": f"Bearer {conn['access_token']}"}
async with aiohttp.ClientSession() as session: async with session.get( "https://graph.microsoft.com/v1.0/me", headers=headers ) as resp: return await resp.json()Common Errors
Section titled “Common Errors”| Error | Cause | Fix |
|---|---|---|
| ”OAuth not configured” | Connection doesn’t exist | Add OAuth connection in Settings |
| 401 Unauthorized | Token expired or wrong scopes | Re-authorize or check scopes |
| ”refresh_token invalid” | Refresh token revoked | Delete and re-authorize |