Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- custom filter
- querydsl
- jquery
- bootstrap jquery datepicker
- rember me
- jstl
- jquery serialize
- JPA
- Drools Fusion
- CEP
- zabbix
- jenkins
- COC
- maven
- Spring
- Hudson
- @SqlResultSetMapping
- spring transaction
- GEventEvaluator
- SVN
- JBoss Seam
- spring jpa
- guvnor
- gwt
- gwt-ext
- drools
- spring security
- ibatis
- MySQL
- java tip
Archives
- Today
- Total
봉 블로그
Spring Security Java Config Example 본문
Restful 한 API 서버에 Spring Security 3.2.5 Java Config Example.
@Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) protected static class ApplicationSecurity extends WebSecurityConfigurerAdapter { @Autowired private SecurityProperties security; @Override public void configure(WebSecurity web) throws Exception { web .ignoring().antMatchers( "/", "/index.html", "/app.js", "/resources/**", "/user/notLogin*", "/user/loginFail*", "/user/accessDenied*", "/user/onAfterLogout*" ); } @Override protected void configure(HttpSecurity http) throws Exception { http .anonymous().disable() .authorizeRequests() .anyRequest().fullyAuthenticated() .and() .exceptionHandling().accessDeniedPage("/user/accessDenied") .and() .formLogin() .loginPage("/user/notLogin") .loginProcessingUrl("/user/login") .defaultSuccessUrl("/user/onAfterLogin", true) .failureUrl("/user/loginFail") .and() .logout() .logoutUrl("/user/logout") .logoutSuccessUrl("/user/onAfterLogout") .and() .csrf().disable(); } @Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth.inMemoryAuthentication().withUser("username").password("password").roles("ADMIN"); } }