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?
I solved this by implementing my own
RunAsManagerthat checks for a custom annotation on the invoked method and returns the appropriate Token.works great.