OAuth Framework: Secure API Token Management
PocketPaw includes a built-in OAuth 2.0 framework that handles authentication with Google and Spotify services.
Supported Providers
| Provider | Services | Flow |
|---|---|---|
| Gmail, Calendar, Drive, Docs | Authorization code | |
| Spotify | Search, playback, playlists | Authorization code |
How It Works
- First use: When a tool requires OAuth (e.g., Gmail), PocketPaw checks for stored tokens
- No token: Opens a browser for the OAuth consent flow
- Authorization: User grants permissions
- Token storage: Tokens are saved to
~/.pocketpaw/tokens/ - Refresh: Expired tokens are automatically refreshed
Configuration
Google OAuth
export POCKETPAW_GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"export POCKETPAW_GOOGLE_CLIENT_SECRET="your-client-secret"Create OAuth credentials at console.cloud.google.com:
- Go to APIs & Services → Credentials
- Create Credentials → OAuth client ID
- Application type: Desktop app
- Download the JSON
Spotify OAuth
export POCKETPAW_SPOTIFY_CLIENT_ID="your-spotify-client-id"export POCKETPAW_SPOTIFY_CLIENT_SECRET="your-spotify-secret"Create an app at developer.spotify.com:
- Create a new app
- Set redirect URI to
http://localhost:8888/callback - Copy the Client ID and Secret
Token Storage
Tokens are stored in ~/.pocketpaw/tokens/:
~/.pocketpaw/tokens/├── google_token.json└── spotify_token.jsonTokens include refresh tokens, so re-authorization is only needed if tokens are revoked.
Dashboard Integration
The web dashboard provides a visual OAuth flow. When configuring Google or Spotify in the Settings panel, clicking “Authorize” opens the consent screen and automatically stores the tokens.
Security
- Tokens are stored with restricted file permissions (600)
- Client secrets are stored in the config file, not in tokens
- The security audit CLI checks token storage permissions
Related
Gmail Integration
Search, read, and send emails through your Gmail account with PocketPaw.
Spotify Integration
Search music, control playback, and manage playlists via AI.
Integrations Overview
Browse all available integrations and learn how they connect.