Skip to content

feat: add OAuth2 Client Credentials auth type#79

Open
steve-wecompare wants to merge 1 commit into
matthiastjong:mainfrom
steve-wecompare:feat/oauth2-client-credentials
Open

feat: add OAuth2 Client Credentials auth type#79
steve-wecompare wants to merge 1 commit into
matthiastjong:mainfrom
steve-wecompare:feat/oauth2-client-credentials

Conversation

@steve-wecompare
Copy link
Copy Markdown
Contributor

Summary

  • Adds oauth2_client_credentials auth type for machine-to-machine OAuth2 flows
  • Uses grant_type=client_credentials (no refresh token needed)
  • Fields: Client ID, Client Secret, Token URL, Scope (optional)
  • Use case: Amazon Creators API, Azure AD, and other M2M APIs

Changes (6 files, ~150 lines)

File What
oauth2.ts New getOAuth2ClientCredentialsToken() with in-memory token caching
gateway.ts Handler to auto-inject Bearer tokens
auth-methods.ts Added to VALID_TYPES + credential hint
auth-method-fields.svelte UI form fields for add + edit
+page.server.ts Server-side form parsing for add + edit
+page.svelte Label mapping

Test plan

  • Add OAuth2 Client Credentials auth to a target via the UI
  • Verify token is fetched and cached on first proxied request
  • Verify cached token is reused for subsequent requests
  • Verify token is refreshed after expiry
  • Edit the auth method and verify fields update correctly

🤖 Generated with Claude Code

Add support for the OAuth2 client_credentials grant type, enabling
machine-to-machine authentication (e.g. Amazon Creators API, Azure AD).

Changes:
- New getOAuth2ClientCredentialsToken() with in-memory token caching
- Gateway handler to auto-inject Bearer tokens
- UI form fields for Client ID, Client Secret, Token URL, and Scope
- Server-side form parsing for add and edit actions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant