호돌맨의 블로그

  • 홈
  • 이력서
음악, 컴퓨터, 서버, IT

Spring Security 2

SpringSecurity에서 anonymous()

Spring에서 테스트를 돌리는 중 Unauthorized(401)가 아닌 Forbidden(403)이 발생하는 문제가 생겼다. @RestController @RequiredArgsConstructor public class PostController { private final PostService postService; @PreAuthorize("isAuthenticated()") @PostMapping("/api/bbs/{name}/posts") public void post(@PathVariable String name, @Valid @RequestBody WritePost request, @AuthenticationPrincipal ExternalUser externalUser) { postSe..

개발/Java,Spring 2019.08.15 (2)

Spring Boot 2.x Security에서 hasPermission 사용

Spring Boot2.x에서 Spring Security를 이용해 권한을 관리 할 수 있다. 기본적으로 Override된 configure(HttpSecurity http)에서 AntMatcher를 이용해 Role확인을 할 수 있다. 하지만 관리 대상과 요구사항이 많아지면 Role만으로는 문제 해결이 용이하지 않다. 그래서 MethodSecurity를 이용한 권한 관리 방법을 간략히 정리한다. Gradle 설정 compile("org.springframework.boot:spring-boot-starter-security") compile("org.springframework.security:spring-security-oauth2-client") compile("org.springframework.s..

개발/Java,Spring 2019.08.11
1
더보기
프로필사진

음악, 컴퓨터, 서버, IT

  • 분류 전체보기 (32)
    • 음악 (1)
    • 해외여행 (7)
      • [2018-01] 홋카이도 (2)
      • [2017-12] 홋카이도 (5)
    • 국내여행 (0)
    • 개발 (24)
      • Linux,Server (7)
      • Java,Spring (5)
      • Frontend (3)
      • Python (0)
      • Database (1)
      • 인생후진기어 (4)

Tag

splitChunks, disable, Illegal byte sequence, null, 우아한형제들, springboot, 홋카이도, unzip, 슈퍼호쿠토, 우아한테크세미나, authenticationprincipal, Spring Security, nginx, 강대명, spring, 에키벤, 유효하지 않은 변수, 회고, 개발자, 호돌맨,

최근글과 인기글

  • 최근글
  • 인기글
  • Nginx logrotate후에 로깅이 안되는 문제 (Nginx not logging after log⋯ 2022.04.27 15:30
  • typescript, babel, jest 모듈 환경 구성 2022.04.23 15:45
  • 2021년 회고 - 항해 전 2021.12.31 15:24
  • 안녕, 우아한형제들 2019.12.15 19:37
  • Nginx에서 upstream서버 keealive 설정 2019.04.30 08:46
  • CentOS에서 python3, pip3 설치 2019.04.01 00:19

최근댓글

  • 개발바닥보다가 연결성없이 뜬금없긴 하지만 전해⋯

    jpplna

  • 개발바닥보고 블로그 까지 왔습니다ㅋㅋ '개발바닥⋯

    춘식이

  • 저희 코파운더분에게 팁스 준비기를 듣고 엄청 고⋯

    anyjava

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

  • 2022/04
  • 2021/12
  • 2021/04
  • 2020/11

Calendar

«   2022/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

75,849

  • Today : 31
  • Yesterday : 139

Copyright © Kakao Corp. All rights reserved.

티스토리툴바