Guest User

Untitled

a guest
Dec 11th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
  2. @Override
  3. protected void configure(HttpSecurity http) throws Exception {
  4. // @formatter:off
  5. http.httpBasic().and()
  6. .authorizeRequests()
  7. .antMatchers("/order/**").hasAuthority("read_order")//(1)
  8. .antMatchers("/order/**").hasIpAddress("192.168.1.45")//(2)
  9. .anyRequest().denyAll();
  10. // @formatter:on
  11. }
  12.  
  13. @Override
  14. protected void configure(AuthenticationManagerBuilder auth) throws Exception {
  15. auth.userDetailsService(userService);
  16. }
Add Comment
Please, Sign In to add comment