Change security-context for method call with spring-security
spring, spring-security
Solution
I solved this by implementing my own `RunAsManager` that checks for a custom annotation on the invoked method and returns the appropriate Token.
works great.
Problem
Currently I'm using spring security and `@PreAuthorize` annotations to secure method calls. Now I want to change the authentication token for a method call like the run-as authentication replacement of spring security allows me to do. Can I configure the replacement on a per method base? Per annotation, SpEL expression.... If not, would it be possible do figure out in the runAsManager what method is called? How would I configure the security config attributes for a secured object, at all?