CustomSecurityConfig ( 비활성화 추가 ) > SPRING_DATA_JPA

본문 바로가기
사이트 내 전체검색

SPRING_DATA_JPA

CustomSecurityConfig ( 비활성화 추가 )

페이지 정보

profile_image
작성자 관리자
댓글 0건 조회 436회 작성일 24-07-18 15:17

본문

package web.config;


import org.springframework.boot.autoconfigure.security.servlet.PathRequest;

import org.springframework.context.annotation.Bean;

import org.springframework.context.annotation.Configuration;

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.configuration.WebSecurityCustomizer;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import org.springframework.security.crypto.password.PasswordEncoder;

import org.springframework.security.web.SecurityFilterChain;


import lombok.extern.log4j.Log4j2;


@Log4j2

@Configuration

//@PreAuthorize 혹은 @PostAuthorize 어노테이션을 이용해서 사전 혹은 사후의 권한을 체크할 수 있다.

@EnableGlobalMethodSecurity(prePostEnabled = true)

public class CustomSecurityConfig {


@Bean

public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {

log.info("-------시큐리티 해제-------");


//http.formLogin();

http.formLogin().loginPage("/member/login");


http.csrf().disable(); //비활성화


return http.build();

}


... 생략 ...

}


댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

사이트 정보

공지사항
자유게시판
질문답변
1:1문의

 

별명 : 터푸가위
주소 : 부산시 동래구 명장로20번길 90
대표 : 박규태
메일 : dancepkt@******.com

접속자집계

오늘
65
어제
206
최대
10,760
전체
280,549
Copyright © dancePKT . All rights reserved.