Skip to content

Comments

feat(oauth): determine OAuth flow from account definition instead of destination definition#6660

Closed
shekhar-rudder wants to merge 1 commit intomasterfrom
int-5712-oauth-logic
Closed

feat(oauth): determine OAuth flow from account definition instead of destination definition#6660
shekhar-rudder wants to merge 1 commit intomasterfrom
int-5712-oauth-logic

Conversation

@shekhar-rudder
Copy link
Member

Summary

  • Refactors OAuth flow detection to prioritize account-level AuthenticationType over destination definition config
  • Moves OAuth detection in router from setup-time to per-batch processing, allowing different accounts for the same destination type to use different auth flows
  • Propagates account information (DeleteAccount/DeliveryAccount) through regulation-worker and router transformer paths

Problem

Currently, we rely on the destination definition to determine whether to use OAuth flow. However, for destinations using accounts, we should use the account definition since a destination can support both non-OAuth and OAuth accounts (e.g., basic auth vs OAuth).

Solution

Updated IsOAuthDestination to:

  1. First check if Account.AccountDefinition.AuthenticationType == "oauth"
  2. Fall back to existing definitionConfig auth type check only if account info is unavailable

This ensures proper OAuth flow selection based on the actual account configuration rather than the destination's general capabilities.

Linear Ticket

https://linear.app/rudderstack/issue/INT-5712/fix-oauth-detection-logic-in-rudder-server

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@github-actions
Copy link

This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.

@github-actions github-actions bot added the Stale label Feb 25, 2026
@shekhar-rudder shekhar-rudder deleted the int-5712-oauth-logic branch February 25, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant