Skip to content

CAMEL-24495: camel-salesforce-maven-plugin - support JWT and Client Credentials authentication, backport to camel-4.22.x - #25976

Merged
davsclaus merged 1 commit into
camel-4.22.xfrom
backport/CAMEL-24495-4.22.x
Aug 31, 2026
Merged

CAMEL-24495: camel-salesforce-maven-plugin - support JWT and Client Credentials authentication, backport to camel-4.22.x#25976
davsclaus merged 1 commit into
camel-4.22.xfrom
backport/CAMEL-24495-4.22.x

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Backport to camel-4.22.x of #25876, already reviewed and merged on main.

Motivation. Salesforce is retiring the USERNAME_PASSWORD grant type in Winter '27 (February 2027). The plugin previously only supported Username-Password authentication, with the grant type hardcoded in the codegen layer. This adds support for the JWT and Client Credentials flows via an explicit authenticationType parameter, with auto-detection from whichever credentials are provided, plus Mojo-level validation that rejects ambiguous credential combinations early.

Not a straight cherry-pick — one conflict, mechanical. docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc doesn't exist on this branch. Per this project's convention, upgrade-guide entries for a backported change belong in the matching camel-4x-upgrade-guide-4_XX.adoc file on main, not duplicated onto the maintenance branch — so that hunk is dropped here.

Follow-up needed on main: this backport's fix should get an entry in camel-4x-upgrade-guide-4_22.adoc on main documenting the change for the 4.22.x line, per the project's backport upgrade-guide policy. Flagging this so it isn't missed — not done as part of this PR.

Built and tested camel-salesforce-codegen and camel-salesforce-maven-plugin on this branch, including the new SalesforceMojoValidationTest.

Claude Code on behalf of davsclaus

Backport of #25876

Original PR: #25876 - CAMEL-24495: camel-salesforce-maven-plugin - support JWT and Client Credentials authentication
Original author: @tmielke
Target branch: camel-4.22.x

…redentials authentication

The Maven plugin previously only supported Username-Password authentication,
hardcoding the grant type in the codegen layer. With Salesforce retiring the
USERNAME_PASSWORD grant type in Winter '27 (February 2027), this adds support
for JWT and Client Credentials flows.

Changes:
- Add authenticationType parameter to explicitly select the auth type
- Refactor codegen login config to use no-arg constructor + setters, enabling
  auto-detection from provided credentials
- Make userName optional (not needed for Client Credentials)
- Add Mojo-level validation for ambiguous credential combinations
- Add manual integration tests for all three authentication types
- Refactor AbstractSalesforceMojoTest into a utility class holding only static
  setup helpers; move login tests into CamelSalesforceLoginManualIT to separate
  test infrastructure from test logic
- Update README.md with per-auth-type requirements and examples

Note: without the ambiguity validation, omitting the password while providing
clientSecret and userName would silently auto-detect Client Credentials instead
of failing for Username-Password. The Mojo now rejects this combination early
with an actionable error message.

(cherry picked from commit b4164ad)

The upgrade-guide entry from main's camel-4x-upgrade-guide-4_23.adoc is dropped
here: that file doesn't exist on this branch, and per this project's convention
upgrade-guide entries for a backported change belong in the matching
camel-4x-upgrade-guide-4_XX.adoc file on main (a follow-up there covering the
4.22.x line), not duplicated onto the maintenance branch itself.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@davsclaus davsclaus added bug Something isn't working components docs labels Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-salesforce/camel-salesforce-codegen
  • components/camel-salesforce/camel-salesforce-maven-plugin

🔬 Scalpel shadow comparison — Scalpel: 10 tested, 29 compile-only — current: 10 all tested

Maveniverse Scalpel detected 39 affected modules (current approach: 10).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 10 modules (2 direct + 8 downstream), skip tests for 29 (generated code, meta-modules)

Modules Scalpel would test (10)
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-salesforce-codegen
  • camel-salesforce-maven-plugin
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (39 modules)
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: Salesforce :: CodeGen
  • Camel :: Salesforce :: Maven Plugin
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving this backport of #25876 to camel-4.22.x.

The original PR was reviewed and approved — the backport carries the same changes (minus the upgrade guide entry, which is main-only). Same files modified, same logic.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

@davsclaus davsclaus added this to the 4.22.1 milestone Aug 31, 2026
@davsclaus davsclaus self-assigned this Aug 31, 2026
@davsclaus
davsclaus merged commit cc7dbaa into camel-4.22.x Aug 31, 2026
4 checks passed
@davsclaus
davsclaus deleted the backport/CAMEL-24495-4.22.x branch August 31, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working components docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants