Modifier and Type | Class and Description |
---|---|
interface |
EnableGlobalMethodSecurity
Enables Spring Security global method security similar to the
|
Modifier and Type | Class and Description |
---|---|
interface |
EnableWebSecurity
Add this annotation to an
@Configuration class to have the Spring Security
configuration defined in any WebSecurityConfigurer or more likely by extending the
WebSecurityConfigurerAdapter base class and overriding individual methods:
@Configuration @EnableWebSecurity public class MyWebSecurityConfiguration extends WebSecurityConfigurerAdapter { @Override public void configure(WebSecurity web) throws Exception { web .ignoring() // Spring Security should completely ignore URLs starting with /resources/ .antMatchers("/resources/**"); } @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/public/**").permitAll() .anyRequest().hasRole("USER") .and() // Possibly more configuration ... |
Modifier and Type | Class and Description |
---|---|
interface |
EnableWebMvcSecurity
Add this annotation to an
@Configuration class to have the Spring Security
configuration integrate with Spring MVC. |
Copyright © 2019. All rights reserved.