호돌맨의 블로그

  • 홈
  • 이력서

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

  • 분류 전체보기 (37)
    • 사진 (2)
    • 음악 (0)
    • 해외여행 (7)
      • [2018-01] 홋카이도 (2)
      • [2017-12] 홋카이도 (5)
    • 개발 (28)
      • Linux,Server (7)
      • Java,Spring (5)
      • Frontend (4)
      • Python (0)
      • Database (1)
      • 우당탕탕 대모험 (7)

Tag

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

최근글과 인기글

  • 최근글
  • 인기글
  • "여러개의 기술을 담당 하니깐 경쟁력이 떨어지는 것 같아요" 2023.01.16 11:08
  • 안국 2022년 12월 30일 2022.12.31 15:02
  • 호돌맨 2022년 총 결산 2022.12.29 13:39
  • "여러개의 기술을 담당 하니깐 경쟁력이 떨어지는 것 같아요" 2023.01.16 11:08
  • 안녕, 우아한형제들 2019.12.15 19:37
  • 호돌맨 2022년 총 결산 2022.12.29 13:39

최근댓글

  • 🙏

    홍구

  • 계속 정진하겠습니다~!

    정진

  • 세계 최초 예능지향 DEV엔터테인먼트 토크쇼!

    피곤한개발자

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

  • 2023/01
  • 2022/12
  • 2022/09
  • 2022/07

Calendar

«   2023/02   »
일 월 화 수 목 금 토
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

방문자수Total

105,873

  • Today : 47
  • Yesterday : 131

Copyright © Kakao Corp. All rights reserved.

티스토리툴바