야심찬 개발 여정

  • 홈
  • 태그
  • 방명록

Spring Security 2

[Spring Security] Repository 계열에서 authentication 객체 사용, SQL Injection 공격

Spring Security, JPA Repository 를 사용하고 있고 진행중인 상황은 인증된 사용자의 정보를 DB 단에서 필터를 해야 한다. 그래서 알아본 결과 Repository 계열에서 @Query 문에 직접 인증 사용자를 필터하는 방법이 있다는 것을 알게되었다. 이전에 배웠던 @PreAuthorize 나 @PreFilter 로 사용자 정보를 가져와서 Service 단을 지나 Repository 에서 활용하려고 했었는데,, 💀 이런 간단한 방법이 있다니 한 번 알아보자! public interface TestRepository extends JpaRepository { @Query("SELECT e FROM YourEntity e WHERE e.username = ?#{principal.user..

Spring Security 2024.01.06

[Spring Security 6] 전역 메서드 보안 - 사전, 사후 권한 부여 @PreAuthorize, @PostAuthorize, @PreFilter, @PostFilter

https://docs.spring.io/spring-security/reference/servlet/authorization/method-security.html Method Security :: Spring Security As already noted, there is a Spring AOP method interceptor for each annotation, and each of these has a location in the Spring AOP advisor chain. Namely, the @PreFilter method interceptor’s order is 100, @PreAuthorize's is 200, and so on. The reason this docs.spring.io 스..

Spring Security 2023.12.22
이전
1
다음
더보기
프로필사진

야심찬 개발 여정

비전공 신입 개발자, 유니의 좌충우돌 개발 여정입니다.🌱

  • Ambitious Dev Journey (46)
    • Plan (0)
    • Project (1)
      • Private (0)
      • Team (0)
      • Handler Exception (1)
    • Frontend (7)
    • Computer Architecture (1)
    • Data Communication (2)
    • OS (2)
    • Network (3)
    • Algorithm (8)
    • Database (0)
    • Java (1)
    • Spring (0)
    • Git (0)
    • Spring Security (2)
    • Certificate (1)
    • IDE (1)
    • SW (1)
    • Deployment and Operations (4)
    • 환경세팅 (9)

Tag

패킷교환방식, TCP/IP 계층, 구간합, 표준화기구, 시스템 소프트웨어 종류, 네트워크, 브루트포스, 도커 파일, 메모리 종류, 윈도우EC2, 컴포즈 파일, 자바, 프로토콜, java, 알고리즘, 백준, 아키텍처도메인, 전사아키텍처, CPU 명령어 처리 단계, CPU 구성정보,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2026/04   »
일 월 화 수 목 금 토
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 :
유니의 Github 방문하기 👈

Copyright © AXZ Corp. All rights reserved.

티스토리툴바