OAuth

The OAuth endpoints handle the authorization code flow for connecting external services. They are not called directly by API clients — they are used by the jeriko connect CLI command and channel commands to authorize connectors.

GET/oauth/:provider/start

Redirect to the OAuth provider's consent page.

The state query parameter is required. It contains a cryptographically random token (256 bits) that expires after 10 minutes and is single-use for CSRF protection.

# 1. CLI generates state token and opens browser
jeriko connect github

# 2. Browser redirects to:
# GET /oauth/github/start?state=<random-token>
# → 302 redirect to GitHub authorization page

# 3. User approves, GitHub redirects back to:
# GET /oauth/github/callback?code=<auth-code>&state=<token>

# 4. Daemon exchanges code for access token
# 5. Connector is now authenticated
GET/oauth/:provider/callback

OAuth callback — exchanges authorization code for access token.

On success, renders an HTML page confirming the connection and sends a notification to the originating chat. On failure, renders an error page.

Supported Providers

ProviderTypeScopes
GitHubOAuthrepo, user, notifications
X (Twitter)OAuth + PKCEtweet.read, users.read
Google DriveOAuthdrive.file
OneDriveOAuthFiles.ReadWrite
GmailOAuthgmail.readonly, gmail.send
OutlookOAuthMail.ReadWrite, Mail.Send
VercelOAuthuser, deployments
HubSpotOAuthcrm.objects.contacts.read, crm.objects.deals.read
ShopifyOAuthread_products, read_orders
InstagramOAuthinstagram_basic, pages_show_list
ThreadsOAuththreads_basic, threads_content_publish

Security

  • State tokens are single-use and expire after 10 minutes
  • X/Twitter uses PKCE (Proof Key for Code Exchange) for additional security
  • Secrets are never logged or exposed in error responses
  • Tokens are stored securely in the daemon’s credential store