Let's take a look at the following steps to configure CustomWebSecurityExpressionHandler:
- We now need to configure CustomWebSecurityExpressionHandler. Fortunately, this can be done easily using the Spring Security namespace configuration support. Add the following configuration to the SecurityConfig.java file:
// src/main/java/com/packtpub/springsecurity/configuration/ SecurityConfig.java http.authorizeRequests() .expressionHandler(customWebSecurityExpressionHandler);
- Now, let's update our initialization SQL query to use the new expression. Update the data.sql file so that it requires the user to be ROLE_ADMIN and requested from the local machine. You will notice that we are able ...