This guide helps CIRISManager administrators configure OAuth authentication for CIRIS agents.
CIRIS agents support OAuth authentication through a shared configuration file. OAuth credentials are stored in /home/ciris/shared/oauth/oauth.json and mounted into agent containers.
Each agent needs these environment variables:
OAUTH_CALLBACK_BASE_URL=https://agents.ciris.ai # Your domain
CIRIS_AGENT_ID=datum # Agent identifierCreate /home/ciris/shared/oauth/oauth.json:
{
"google": {
"client_id": "YOUR_GOOGLE_CLIENT_ID",
"client_secret": "YOUR_GOOGLE_CLIENT_SECRET",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token"
},
"discord": {
"client_id": "YOUR_DISCORD_CLIENT_ID",
"client_secret": "YOUR_DISCORD_CLIENT_SECRET",
"auth_uri": "https://discord.com/oauth2/authorize",
"token_uri": "https://discord.com/api/oauth2/token"
},
"github": {
"client_id": "YOUR_GITHUB_CLIENT_ID",
"client_secret": "YOUR_GITHUB_CLIENT_SECRET",
"auth_uri": "https://github.com/login/oauth/authorize",
"token_uri": "https://github.com/login/oauth/access_token"
}
}- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
Example:
https://agents.ciris.ai/v1/auth/oauth/{agent_id}/google/callbackhttps://agents.ciris.ai/v1/auth/oauth/datum/google/callback
- Go to Discord Developer Portal
- Create a new application
- Navigate to OAuth2 settings
- Add redirect URL:
https://agents.ciris.ai/v1/auth/oauth/{agent_id}/discord/callback - Copy Client ID and Client Secret
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click "New OAuth App"
- Set Authorization callback URL:
https://agents.ciris.ai/v1/auth/oauth/{agent_id}/github/callback - Copy Client ID and Client Secret
Ensure your agent mounts the OAuth configuration:
services:
agent-datum:
volumes:
- oauth_shared:/home/ciris/.ciris
volumes:
oauth_shared:
driver: local
driver_opts:
type: none
o: bind
device: /home/ciris/shared/oauth-
File Permissions: Set restrictive permissions on oauth.json
chmod 600 /home/ciris/shared/oauth/oauth.json chown ciris:ciris /home/ciris/shared/oauth/oauth.json
-
Never commit OAuth credentials to version control
-
Use HTTPS only for callback URLs
-
Rotate credentials regularly
After configuration:
- Visit:
https://agents.ciris.ai/api/{agent_id}/v1/auth/oauth/{provider}/authorize - Complete OAuth flow
- Check agent logs for successful authentication
Common Issues:
- "Provider not configured": Check oauth.json exists and is readable
- Invalid redirect URI: Ensure callback URL matches exactly in provider settings
- Permission denied: Check file permissions and volume mounts
Debug Commands:
# Check if OAuth config is mounted
docker exec ciris-agent-datum ls -la /home/ciris/.ciris/
# View OAuth providers
curl https://agents.ciris.ai/api/datum/v1/auth/oauth/providers
# Check agent logs
docker logs ciris-agent-datumWhen creating agents through CIRISManager:
- OAuth configuration is automatically mounted from shared volume
- Set
OAUTH_CALLBACK_BASE_URLin agent environment - Ensure
CIRIS_AGENT_IDmatches the agent identifier
The shared OAuth configuration allows all agents to use the same OAuth apps, simplifying management.