Allow injecting a custom AuthProviderFactory to let frameworks own authentication#1487
Merged
Merged
Conversation
…thentication Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes authentication resolution pluggable by allowing a WorkflowApplication to be configured with a custom AuthProviderFactory, enabling frameworks (e.g., Quarkus) to supply the Authorization header and bypass the SDK’s built-in OAuth2/OIDC token exchange when desired.
Changes:
- Introduces
AuthProviderFactoryas an interface and addsDefaultAuthProviderFactoryto preserve current default behavior. - Wires auth resolution through
WorkflowApplication.authProviderFactory()in the HTTP executor path and resource loading path. - Adds a test verifying that a framework-provided factory can inject an auth header and that no token exchange is performed.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| impl/test/src/test/java/io/serverlessworkflow/impl/test/CustomAuthProviderFactoryOverrideTest.java | Adds an integration-style test covering factory override behavior and ensuring no OAuth token exchange occurs. |
| impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/HttpExecutorBuilder.java | Switches HTTP auth provider resolution to use the application’s injected factory. |
| impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowApplication.java | Adds an AuthProviderFactory field, builder setter, and accessor for injection + defaulting. |
| impl/core/src/main/java/io/serverlessworkflow/impl/resources/ResourceLoader.java | Routes endpoint-auth resolution through the application’s injected factory. |
| impl/core/src/main/java/io/serverlessworkflow/impl/auth/DefaultAuthProviderFactory.java | Extracts the previous static factory behavior into the default implementation. |
| impl/core/src/main/java/io/serverlessworkflow/impl/auth/AuthProviderFactory.java | Converts factory from static utility class to injectable interface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fjtirado
reviewed
Jun 25, 2026
fjtirado
reviewed
Jun 25, 2026
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
fjtirado
reviewed
Jun 25, 2026
fjtirado
approved these changes
Jun 25, 2026
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
fjtirado
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Many thanks for submitting your Pull Request ❤️!
What this PR does / why we need it:
This pull request allows a framework to inject a own AuthProviderFactory to control how the exchange token is made.
Special notes for reviewers:
Additional information (if needed):
Closes #1486