How to apply different authentication settings to different services/methods (Spring security) #286
-
The setupImagine we have a gRPC server application. All services are authenticated. We want to add a service or a single rpc that is publicly accessible (without an account). In the conventional Spring Security world, we'd add a matcher like this:
to the HTTP security configuration. The problemThe aforementioned methods and not available in The questionI know I can use the I'd greatly appreciate if someone could point me to the right direction. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
If you have a look at this api you can get the idea how to achieve what you are after. Just inject |
Beta Was this translation helpful? Give feedback.
If you have a look at this api you can get the idea how to achieve what you are after. Just inject
GRpcServicesRegistry
into your adapter bean, filter services you want to secure and call services method.You should be using strongly typed generated service descriptor to filter it out from the all the services.