게시판 : 임시 전체 허용
This commit is contained in:
parent
b786824261
commit
c1f5d1617f
@ -1,106 +1,107 @@
|
|||||||
package nlib.security;
|
package nlib.security;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.authentication.AuthenticationProvider;
|
import org.springframework.security.authentication.AuthenticationProvider;
|
||||||
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
||||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
|
|
||||||
import nlib.cmm.crypto.NlibPasswordEncoder;
|
import nlib.cmm.crypto.NlibPasswordEncoder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* @Class Name : SpringSecurityConfig.java
|
* @Class Name : SpringSecurityConfig.java
|
||||||
*
|
*
|
||||||
* @Description : Spring Security 환경설정 클래스
|
* @Description : Spring Security 환경설정 클래스
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @ ------------ -------- ---------------------------
|
* @ ------------ -------- ---------------------------
|
||||||
* @ 수정일 수정자 수정내용
|
* @ 수정일 수정자 수정내용
|
||||||
* @ ------------ -------- ---------------------------
|
* @ ------------ -------- ---------------------------
|
||||||
* @ 2021. 7. 6. KNKIM 최초 생성
|
* @ 2021. 7. 6. KNKIM 최초 생성
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||||
* @since 2021. 7. 6.
|
* @since 2021. 7. 6.
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
@EnableGlobalMethodSecurity(securedEnabled = true)
|
@EnableGlobalMethodSecurity(securedEnabled = true)
|
||||||
public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configure(WebSecurity web) throws Exception {
|
public void configure(WebSecurity web) throws Exception {
|
||||||
web.ignoring()
|
web.ignoring()
|
||||||
.antMatchers("/resources/**")
|
.antMatchers("/resources/**")
|
||||||
.antMatchers("/css/**")
|
.antMatchers("/css/**")
|
||||||
.antMatchers("/images/**")
|
.antMatchers("/images/**")
|
||||||
.antMatchers("/js/**")
|
.antMatchers("/js/**")
|
||||||
.antMatchers("/temp/**")
|
.antMatchers("/temp/**")
|
||||||
.antMatchers("/favicon/**")
|
.antMatchers("/favicon/**")
|
||||||
.antMatchers("/*/*Ajax.do")
|
.antMatchers("/*/*Ajax.do")
|
||||||
;
|
.antMatchers("/board/**")
|
||||||
}
|
;
|
||||||
|
}
|
||||||
@Override
|
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
@Override
|
||||||
http.authorizeRequests()
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
.antMatchers("/login/login*.do").permitAll()
|
http.authorizeRequests()
|
||||||
.antMatchers("/login/logout*.do").permitAll()
|
.antMatchers("/login/login*.do").permitAll()
|
||||||
.antMatchers("/login/naver*.do").permitAll()
|
.antMatchers("/login/logout*.do").permitAll()
|
||||||
.antMatchers("/member/*.do").permitAll()
|
.antMatchers("/login/naver*.do").permitAll()
|
||||||
.antMatchers("/member/*.ajax").permitAll()
|
.antMatchers("/member/*.do").permitAll()
|
||||||
.antMatchers("/userInfo/*.do").permitAll()
|
.antMatchers("/member/*.ajax").permitAll()
|
||||||
.antMatchers("/info/inform/*.do").permitAll()
|
.antMatchers("/userInfo/*.do").permitAll()
|
||||||
.antMatchers("/").permitAll()
|
.antMatchers("/info/inform/*.do").permitAll()
|
||||||
.antMatchers("/index.jsp").permitAll()
|
.antMatchers("/").permitAll()
|
||||||
.antMatchers("/index.do").permitAll()
|
.antMatchers("/index.jsp").permitAll()
|
||||||
.antMatchers("/main/header.do").permitAll()
|
.antMatchers("/index.do").permitAll()
|
||||||
.antMatchers("/main/menu.do").permitAll()
|
.antMatchers("/main/header.do").permitAll()
|
||||||
.antMatchers("/sample/password/getSampleEncoder.do").permitAll()
|
.antMatchers("/main/menu.do").permitAll()
|
||||||
.anyRequest().authenticated()
|
.antMatchers("/sample/password/getSampleEncoder.do").permitAll()
|
||||||
.and().formLogin()
|
.anyRequest().authenticated()
|
||||||
.loginPage("/login/loginForm.do")
|
.and().formLogin()
|
||||||
.permitAll()
|
.loginPage("/login/loginForm.do")
|
||||||
.and().csrf()
|
.permitAll()
|
||||||
.disable();
|
.and().csrf()
|
||||||
|
.disable();
|
||||||
http.logout()
|
|
||||||
.logoutSuccessUrl("/login/loginForm.do?logout")
|
http.logout()
|
||||||
.invalidateHttpSession(true).deleteCookies("JSESSIONID")
|
.logoutSuccessUrl("/login/loginForm.do?logout")
|
||||||
;
|
.invalidateHttpSession(true).deleteCookies("JSESSIONID")
|
||||||
}
|
;
|
||||||
|
}
|
||||||
@Bean
|
|
||||||
@Override
|
@Bean
|
||||||
public AuthenticationManager authenticationManagerBean() throws Exception {
|
@Override
|
||||||
return super.authenticationManagerBean();
|
public AuthenticationManager authenticationManagerBean() throws Exception {
|
||||||
}
|
return super.authenticationManagerBean();
|
||||||
|
}
|
||||||
@Bean
|
|
||||||
public UserDetailsService userDetailsService() {
|
@Bean
|
||||||
return new SecUserDetailsService();
|
public UserDetailsService userDetailsService() {
|
||||||
}
|
return new SecUserDetailsService();
|
||||||
|
}
|
||||||
@Bean
|
|
||||||
public PasswordEncoder getPasswordEncoder() {
|
@Bean
|
||||||
return new NlibPasswordEncoder();
|
public PasswordEncoder getPasswordEncoder() {
|
||||||
}
|
return new NlibPasswordEncoder();
|
||||||
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user