Small question regarding how to use Spring Security to specify which client certificate can access what specific predefined endpoint, please.
By predefined endpoint, I mean the web application has default endpoint (not those I defined via @RestController) such as the actuator endpoint /actuator/health, /actuator/prometheus, or the Spring Cloud Config endpoints, such as /config/myservice/ There is no possibility to @PreAuthorize.
I would like to just specify which client certificate can access which endpoint, such as:
- Client certificate with
UID=Alicecan access/actuator/healthand/config/myservice. - Client certificate with
UID=Bobcan access/actuator/prometheus
There are many examples online on, How to extract X509 certificate:
- https://www.baeldung.com/x-509-authentication-in-spring-security
- https://blog.codecentric.de/en/2018/08/x-509-client-certificates-with-spring-security/
But how to configure it in the application, i.e., this sort of mapping of which certificate can access what?
Thank you