You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/09/02 14:44:00 UTC

[jira] [Resolved] (CAMEL-14512) camel-grpc - Allow reference to custom ClientInterceptor or Producer to customize authentication

     [ https://issues.apache.org/jira/browse/CAMEL-14512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-14512.
---------------------------------
    Resolution: Abandoned

> camel-grpc - Allow reference to custom ClientInterceptor or Producer to customize authentication
> ------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-14512
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14512
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-grpc
>         Environment: * Java 11
> * SpringBoot 2.1.5.RELEASE
> * CamelĀ 3.0.0-M2
> * Camel-Grpc-StarterĀ 3.0.0-M2
>            Reporter: Philipp
>            Priority: Minor
>             Fix For: 3.x
>
>
> The [GRPC component|https://github.com/apache/camel/blob/master/components/camel-grpc/src/main/docs/grpc-component.adoc] does currently not offer the possibility to intercept the connection establishment against the gRPC server out of the box.
> This prevents to add custom authentication to the channel/connection setup. And since the gRPC component does not offer this custom implementation out of the box, the currently only solution is:
> * Implement a custom {{GrpcComponent}}
> * Implement a custom {{GrpcEndpoint}}
> * Implement a custom {{GrpcProducer}} or {{DefaultAsyncProducer}}
> ** Override the {{doStart()}} method
> ** Instantiate the {{Channel}}
> ** Add a custom {{ClientInterceptor}} and override the {{interceptCall()}} method
> ** Add headers to the metadata of the prepared call
> Even though there are the properties {{authenticationType=JWT}}, {{jwtSecret}}, {{jwtIssuer}} and so on, these arguments only allow constant strings. Therefore, no retrieval of OAuth tokens (for example) during the runtime is possible, but everything would have to be hard-coded.
> The [AHC-WS component|https://github.com/apache/camel/blob/master/components/camel-ahc-ws/src/main/docs/ahc-ws-component.adoc] in contrast, offers this possibility by implementing a custom {{AsyncHttpClient}} and pointing to it via the {{camel.component.ahc-ws.client}} property in the {{application.yml}}. Like this, the connection setup of the websocket can easily be intercepted by overriding {{DefaultAsyncHttpClient.prepareGet()}} where OAuth tokens (for example) can be passed and added to the handshake.



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