Federico Mariani created CAMEL-23093:
----------------------------------------

             Summary: Add OAuth SPI for multi-IdP Client Credentials support
                 Key: CAMEL-23093
                 URL: https://issues.apache.org/jira/browse/CAMEL-23093
             Project: Camel
          Issue Type: New Feature
          Components: camel-oauth
    Affects Versions: 4.18.0
            Reporter: Federico Mariani
            Assignee: Federico Mariani
             Fix For: 4.19.0


Add an OAuth 2.0 Client Credentials SPI (OAuthClientAuthenticationFactory) so 
Camel components can acquire bearer tokens from identity providers without a 
compile-time dependency on camel-oauth. Supports multiple identity providers 
via named profiles.

Right now the camel-oauth component can be used only with a processor, for 
example:
{code:java}
from("direct:callProtectedApi")
      .process(new OAuthClientCredentialsProcessor())
      // Authorization header is now set
      .to("http://my-backend/api/resource";); {code}

This behaviour can be improvied with an SPI that can be used by Camel 
components to acquire bearer tokens for Client Credentials scenario. Moreover, 
the actual implementation does not provide multiple IdPs integration, this has 
to be handled as well. In particular, something like:
{code:java}
            uri: openai:chat-completion
            parameters:
              apiKey: no-key
              model: qwen3:4b-instruct
              baseUrl: http://localhost:11434/v1
              mcpServer.tools.transportType: streamableHttp
              mcpServer.tools.url: http://localhost:8080/mcp
              mcpServer.tools.oauthProfile: myKeycloak {code}
Should be doable with an application.properties like:
{code:java}
camel.oauth.myKeycloak.client-id=test-app
camel.oauth.myKeycloak.client-secret=test-secret
camel.oauth.myKeycloak.token-endpoint=http://localhost:8543/realms/test/protocol/openid-connect/token
 {code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to