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 |
Tags
- maven
- gwt
- Drools Fusion
- jquery
- jquery serialize
- MySQL
- COC
- SVN
- querydsl
- GEventEvaluator
- Hudson
- zabbix
- bootstrap jquery datepicker
- @SqlResultSetMapping
- spring transaction
- java tip
- JBoss Seam
- drools
- jstl
- jenkins
- JPA
- rember me
- Spring
- CEP
- gwt-ext
- custom filter
- spring jpa
- ibatis
- spring security
- guvnor
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"); } }