Skip to content

feat: add Reddit OAuth2 bundled provider#390

Merged
manojbajaj95 merged 1 commit into
mainfrom
chore/reddit
Jun 9, 2026
Merged

feat: add Reddit OAuth2 bundled provider#390
manojbajaj95 merged 1 commit into
mainfrom
chore/reddit

Conversation

@ankitranjan7

Copy link
Copy Markdown
Collaborator

Motivation

This adds Reddit as a bundled OAuth provider. Reddit’s OAuth implementation differs from the default provider behavior in two important ways: token exchanges require HTTP Basic client authentication, and the authorization request needs a duration parameter when requesting long-lived access. Supporting Reddit cleanly meant making those provider-specific OAuth details configurable instead of hardcoding Reddit logic into the flow.

What Changed

  • Added a bundled Reddit provider definition.
  • Added provider-level support for token endpoint auth via either form-body credentials or HTTP Basic auth.
  • Applied that token auth behavior across PKCE code exchange, device-code token polling, and refresh-token exchange.
  • Added provider-level authorization URL parameters so providers like Reddit can request duration=permanent.
  • Added regression coverage for provider authorization params and Basic-auth refresh behavior.
  • Kept existing OAuth providers on the default form-body credential behavior.

@ankitranjan7 ankitranjan7 requested a review from beubax June 8, 2026 17:08
"authorization_params": {
"duration": "permanent"
},
"_comment": "Reddit API strictly requires HTTP Basic Auth for token exchanges rather than payload credentials. See: https://github.com/reddit-archive/reddit/wiki/OAuth2#retrieving-the-access-token"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch to jsonc and add comments there

@manojbajaj95 manojbajaj95 merged commit 654e8f7 into main Jun 9, 2026
5 checks passed
@manojbajaj95 manojbajaj95 deleted the chore/reddit branch June 9, 2026 03:43
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.

2 participants