Details
-
New Feature
-
Status: Resolved
-
Minor
-
Resolution: Abandoned
-
None
-
None
-
- Java 11
- SpringBoot 2.1.5.RELEASE
- CamelĀ 3.0.0-M2
- Camel-Grpc-StarterĀ 3.0.0-M2
-
Unknown
Description
The GRPC component 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 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.
Attachments
Issue Links
- is fixed by
-
CAMEL-15813 camel-grpc add ClientInterceptors to the channel
- Resolved