본문 바로가기 메뉴 바로가기

Development Diary

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Development Diary

검색하기 폼
  • 분류 전체보기 (144)
    • Java (74)
      • Effective Java (72)
      • Algorithm (0)
    • Spring (44)
      • Spring MVC (5)
      • Spring Framework (10)
      • Spring Data (9)
      • Spring Batch (0)
      • Spring Security (9)
      • Spring HATEOAS (0)
      • Spring Setting (6)
      • Spring Cloud (3)
      • Spring Template (1)
    • AWS (1)
    • DB (2)
    • Paper (0)
    • CS (2)
    • Project (16)
    • 잡다구리 (5)
  • 방명록

@PreAuthorize method (1)
  • 분류 전체보기 (144)
    • Java (74)
      • Effective Java (72)
      • Algorithm (0)
    • Spring (44)
      • Spring MVC (5)
      • Spring Framework (10)
      • Spring Data (9)
      • Spring Batch (0)
      • Spring Security (9)
      • Spring HATEOAS (0)
      • Spring Setting (6)
      • Spring Cloud (3)
      • Spring Template (1)
    • AWS (1)
    • DB (2)
    • Paper (0)
    • CS (2)
    • Project (16)
    • 잡다구리 (5)
[PreAuthorize] Annotation Custom Check Method, 커스텀 체크

Spring Security를 사용할 때 권한 체크를 간단히 할 수 있는 방법은 URL 방식과 Method 방식이 있다 Method 방식은 AOP 방식을 기반으로 한다 특히 @EnableGlobalMethodSecurity 설정을 활성화해 아주 간단히 이용할 수 있다 해당 애너테이션을 찾아가 보면 활성화할 수 있는 요소들을 확인할 수 있다 Role만 지정해주는 간단한 사용을 위해서는 securedEnabled = true로 주면 되고 권한 검증에 SpEL을 사용하려면 prePostEnabled = true로 주면 된다 모든 설정은 default false이기 때문에 나는 간단한 방식과 SpEL을 사용하는 방식을 혼용하기 위해 두 설정을 켜줬다 아래와 같이 사용하고자 하는 설정을 켜주고 SecurityCo..

Spring/Spring Security 2021. 10. 11. 03:32
이전 1 다음
이전 다음
링크
  • GitHub 🐼
글 보관함
«   2025/06   »
일 월 화 수 목 금 토
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
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바