Seemingly Online
close
프로필 배경
프로필 로고

Seemingly Online

  • 카테고리 (566)
    • Language (250)
      • 알고리즘 (100)
      • Java (144)
      • python (2)
      • Kotlin (4)
    • WEB (139)
      • Spring (23)
      • Spring Security (3)
      • Next.js (3)
      • TypeScript (3)
      • JavaScript (45)
      • jQuery (7)
      • CSS (25)
      • XML (3)
      • Maven (1)
      • Gradle (1)
      • JSP (1)
      • Thymeleaf (10)
      • HTML (11)
      • MyBatis (1)
      • JPA (2)
    • App (44)
      • Flutter (33)
      • Dart (4)
      • Android (2)
      • IOS (3)
      • Firebase (2)
    • Git (6)
      • GitHub (6)
    • AWS (15)
      • SCT (2)
      • Amazon Aurora (1)
      • S3 (2)
      • EventBridge (1)
      • EC2 (7)
      • EFS (1)
    • DataBase (43)
      • MySQL (19)
      • Oracle SQL (19)
      • Postgre-SQL (5)
    • OS (32)
      • Linux (27)
      • Windows (1)
      • Mac (4)
    • Tool (15)
      • DocKer (6)
      • Intellij (7)
      • VScode (2)
    • IT (17)
      • Developer-etc (13)
      • 개발상식 (4)
    • CodePen (2)
      • 캐러셀 (2)
  • 홈
  • 방명록
Spring Security 에서 Authentication 의 isAuthenticated() 가 항상 true 인 이유

Spring Security 에서 Authentication 의 isAuthenticated() 가 항상 true 인 이유

2024-04-01 1. 예시 코드 아래와 같은 코드가 있다고 가정해 보자. 해당 코드의 결과는 항상 로그인이 되어 있든 로그인이 되어 있지 않던 로그아웃을 하던 "if (authentication.isAuthenticated()) log.info("인증됨")" 코드가 실행된다. 즉 authentication.isAuthenticated() 이 부분이 항상 true를 리턴한다. 그 이유는 무엇일까? Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication.isAuthenticated()) log.info("인증됨") else log.info("인증안됨") } 2. 원인 S..

  • format_list_bulleted WEB/Spring Security
  • · 2024. 4. 1.
  • textsms
[Spring Security] SecurityContextHolder와 사용자 정보

[Spring Security] SecurityContextHolder와 사용자 정보

2023-01-24 1. 정의 SecurityContextHolder는 기본적으로 security context에 접근하는 것을 도와주는 클래스라고 볼 수 있다. 또한 해당 클래스를 호출하여 실행할 때마다 동일 스레드에서 가져온다. 추가적으로 Spring Security 가 자체적으로 메모리를 관리하기 때문에 메모리 누수를 걱정하지 않아도 된다고 한다. 이제 SecurityContextHolder 가 어떻게 사용자 정보를 가져오는지 보자. 2. 방법 아래의 코드는 현재 로그인한 유저 정보를 가져오는 구체적인 코드이다. 해당코드에서 SecurityContextHolder 는 security context의 정보를 가져와 security context 가 가지고 있는 사용자의 정보를 조회하여 변수에 할당하는..

  • format_list_bulleted WEB/Spring Security
  • · 2023. 1. 24.
  • textsms
[Spring Security] 로그인 유저 이름과 / 권한 확인하는 방법

[Spring Security] 로그인 유저 이름과 / 권한 확인하는 방법

2022-12-18 1. 방법 유저의 권한의 경우 Authentication 객체를 사용해 현재 로그인한 유저의 권한 정보를 가져오고 자신이 구현한 서비스에 접근 권한이 있는지 없는지를 확인할 수 있는 flag 변수를 선언함으로써, 접근 제어를 설정할 수 있게끔 소스코드를 구현했다. 이후 접근 권한이 있을 경우 유저의 계정 정보를 확인할 수 있도록 UserDetails 객체를 사용하여 유저의 계정명을 가져온다. import import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.co..

  • format_list_bulleted WEB/Spring Security
  • · 2022. 12. 18.
  • textsms
  • navigate_before
  • 1
  • navigate_next
공지사항
전체 카테고리
  • 카테고리 (566)
    • Language (250)
      • 알고리즘 (100)
      • Java (144)
      • python (2)
      • Kotlin (4)
    • WEB (139)
      • Spring (23)
      • Spring Security (3)
      • Next.js (3)
      • TypeScript (3)
      • JavaScript (45)
      • jQuery (7)
      • CSS (25)
      • XML (3)
      • Maven (1)
      • Gradle (1)
      • JSP (1)
      • Thymeleaf (10)
      • HTML (11)
      • MyBatis (1)
      • JPA (2)
    • App (44)
      • Flutter (33)
      • Dart (4)
      • Android (2)
      • IOS (3)
      • Firebase (2)
    • Git (6)
      • GitHub (6)
    • AWS (15)
      • SCT (2)
      • Amazon Aurora (1)
      • S3 (2)
      • EventBridge (1)
      • EC2 (7)
      • EFS (1)
    • DataBase (43)
      • MySQL (19)
      • Oracle SQL (19)
      • Postgre-SQL (5)
    • OS (32)
      • Linux (27)
      • Windows (1)
      • Mac (4)
    • Tool (15)
      • DocKer (6)
      • Intellij (7)
      • VScode (2)
    • IT (17)
      • Developer-etc (13)
      • 개발상식 (4)
    • CodePen (2)
      • 캐러셀 (2)
최근 글
인기 글
최근 댓글
태그
  • #backjoon
  • #자바
  • #BOJ
  • #백준알고리즘
  • #자바기초
  • #Java8
  • #Java
  • #백준
  • #자바공부
  • #자바알고리즘
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바