November 2017
Intermediate to advanced
542 pages
14h 24m
English
In order for our new method to become available, we need to create a custom SecurityExpressionHandler interface that utilizes our new root object. This is as simple as extending WebSecurityExpressionHandler, as follows:
//src/main/java/com/packtpub/springsecurity/web/access/expression/ CustomWebSecurityExpressionHandler.java @Component public class CustomWebSecurityExpressionHandler extends DefaultWebSecurityExpressionHandler { private final AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl(); protected SecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, FilterInvocation fi) { WebSecurityExpressionRoot root = new CustomWebSecurityExpressionRoot(authentication, ...Read now
Unlock full access