Create OAuth Client ID
Select application type
Choose Desktop app as the application type.Give your OAuth client a name (e.g., “AgenticPal Desktop”) and click Create.
Desktop app credentials work for both CLI and local development. For web deployments, you’ll need to create a “Web application” OAuth client instead.
Configure Credentials File
The downloaded JSON file needs to be placed in your project directory.Required Scopes
AgenticPal uses the following OAuth scopes defined inauth.py:10:
Scope Details
Google Calendar - https://www.googleapis.com/auth/calendar
Google Calendar - https://www.googleapis.com/auth/calendar
Permissions granted:
- View and edit calendar events
- Create and delete events
- Manage calendar settings
- Adding meetings and appointments
- Listing upcoming events
- Modifying or deleting calendar entries
Gmail - https://mail.google.com/
Gmail - https://mail.google.com/
Permissions granted:
- Read all emails
- Send emails
- Modify labels and filters
- Manage drafts
- Reading and summarizing emails
- Email search and filtering
- Future: Email management features
Google Tasks - https://www.googleapis.com/auth/tasks
Google Tasks - https://www.googleapis.com/auth/tasks
Permissions granted:
- View and edit tasks
- Create and delete tasks
- Manage task lists
- Creating and managing to-do items
- Marking tasks complete
- Listing tasks and task lists
Authentication Flow
When you first run AgenticPal, the authentication flow works as follows:- Check for existing token: AgenticPal looks for
token.json(auth.py:34) - Token refresh: If the token exists but is expired, it attempts to refresh (
auth.py:37-41) - Browser consent: If no valid token exists, a browser window opens for OAuth consent (
auth.py:49-50) - Token caching: After successful authentication, the token is saved to
token.json(auth.py:52)
Testing Authentication
You can test your OAuth setup by running the auth module directly:Troubleshooting
FileNotFoundError: Missing OAuth client file
FileNotFoundError: Missing OAuth client file
- Ensure
credentials.jsonis in your project root directory - Verify the file name is exactly
credentials.json(lowercase) - Check that the file contains valid JSON
Access blocked: Authorization Error
Access blocked: Authorization Error
Refresh token expired or revoked
Refresh token expired or revoked
- Delete
token.jsonand re-authenticate - This happens if the token was revoked in Google Account settings
- Run
python -m authto generate a new token
Next Steps
Environment Configuration
Set up environment variables and LLM API keys