본문 바로가기

분류 전체보기42

DynamoDB 사용법 테이블 생성 aws dynamodb create table \    --table-name Chatroom \    // 테이블 이름    --attribute-definitions \ // 테이블에 사용할 컬럼을 지정하는 것. 각 속성은 이름과 데이터 타입을 지정해야함.        AttributeName=id,AttributeType=S \        AttributeName=date,AttributeType=S \    --key-schema \    // key에 대한 schema 지정.  즉, 테이블의 기본키인 것임.        AttributeName=id,KeyType=HASH \        AttributeName=date,KeyType=RANGE \    --provisioned-.. 2024. 7. 15.
[Spring Security 6.x] Authentication Manager / Authentication Provider 1.  Athentication Manager Authentication Manager는 Filter로부터 Authentication 객체를 전달받은 이후 해당 객체에 대한 인증 처리를 Authentication Provider 객체에게 위임한다.만약 Provider에 의해 정상적으로 인증이 완료되었다면 사용자 정보, 권한 등이 완전히 채워진 Authentication 객체를 Provider로부터 받아 이를 Filter에게 넘겨준다. 즉, 일련의 과정 자체를 봤을 때 Authentication Manager는 인증을 위한 Provider와 인증 전 Filter를 연결하기 위한 다리 역할을 하고 있는 것이다. 이 과정 속에서 Authentication Manager에는 여러 Authentication Pr.. 2024. 6. 22.
[Spring Security 6.x] SecurityContext / SecurityContextHolder 목차AuthenticationSecurityContextHolder 1. AuthenticationAuthentication은 가장 기본적인 방식인 Form 인증을 예로 들었을 때, 사용자의 아이디와 패스워드를 기반으로인증을 수행하고, 그에 따른 인가를 허용할 때 사용하는 객체이다.해당 흐름도를 살펴보면 총 2번의 Authentication이 등장하는 데, 사용하는 클래스 및 자료의 구성 자체는 같으나내부적으로 들어가는 속성에는 변화가 존재한다. Principal과 Authentication은 각각 인터페이스로, Authentication은 Principal을 상속받은 인터페이스이다.메서드의 세부적인 내용은 아래의 표와 같다.  getPrincipal()인증 주체를 의미함.인증 전에는 Username(아.. 2024. 6. 22.
[Spring Security 6.x] FormLogin 동작 방식 Spring Security에서 기본적으로 제공하는 인증 방법은 FormLogin 방식과 HttpBasic 요청 2가지가 존재한다. 목차formLogin()UsernamePasswordAuthenticationFilter1. formLogin() formLogin은 Http 기반의 폼 로그인 기반 인증을 실행해주는 API로, 사용자 인증을 위한 로그인 페이지, 로그아웃 페이지, 로그인 기능등을 제공해준다.이러한 제공사항들을 토대로 사용자는 username과 password를 입력함으로써 서버로부터 인증을 수행받는다. 1-1 formLogin()의 APImethod 이름parameter기능loginPageString로그인페이지의 URL을 지정.해당 URL을 지정하면 Security가 제공하는 기본 로그인페.. 2024. 6. 15.