본문 바로가기

Spring4

Spring Security와 JWT package com.softnet.oceanback.config;import com.softnet.oceanback.config.jwt.JwtAuthenticationEntryPoint;import com.softnet.oceanback.config.jwt.JwtSecurityConfig;import com.softnet.oceanback.config.jwt.TokenProvider;import lombok.RequiredArgsConstructor;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.secur.. 2024. 6. 10.
Spring Boot 와 Oauth2 구축 github oauth를 활용하여 oauth를 구현해보는 실습을 할 것 이다. Github 및 Spring Security 로 어플리케이션 보안spring-boot-starter-oauth2-client소셜 로그인(github) 을 하려면 Spring Security Oauth 2.0 클라이언트 스타터를 포함해야한다. Github를 인증 provider 로서 앱을 구성하기application을 다음과 같이 등록한다.http://localhost:8080OAuth redirection URI 는 최종 사용자 에이전트가 GitHub에 인증하고 application 승인 페이지에서 액세스 권한을 부여한 후 다시 리디렉션되는 어플리케이션의 경로이다.아래는 기본 리디렉션 URI 템플릿이다.{baseUrl}/log.. 2024. 6. 10.
Spring Security Architecture 이해하기 1. HttpRequest 를 보내면 Dispatcher Servlet 에 도착하기전에 filter가 낚아챈다.request의 종류에 따라 BasicAuthenticationFilter, UsernamePasswordAuthenticationFilter 등의 다른 종류의 Authentication Filter가 작동한다. 이 때 AuthenticationFilter에게 올바른 id와 password가 간다면 Authentication 객체를 만든다. 그런다음 UsernamePasswordAuthenticationToken이 만들어진다.  4. Authentication Manager 은 input으로 Authentication object 갖고 인증 완료후에 다시 Authentication object를.. 2024. 6. 10.
static 과 Bean 처음 Bean을 책으로나 강의 접했을 때 정말 와닿지 않았다. 실제 개발을 하다보니 의문점이 생겼고 역으로 이해를 하게 되어 공유하고 싶어졌다. 나의 경우는 static과의 차이점을 알아내니 이해하기 쉬웠다. 시작하기 앞서 선지식이 필요하다. 선지식으로 1.객체지향 개발의 지향점과 2.static과 instance의 메모리 할당 시점을 알아야 한다. 1.객체간의 결합은 약하고 유연성은 높게 2.메모리 할당 시점: static은 메소드 영역에 할당되고, instance 힙에 할당 된다. 스택은 메서드 호출과 관련된 정보를 저장하는 데 사용되며, 메서드 호출이 끝나면 해당 프레임이 스텍에서 제거된다. 본론으로 돌아가서 static을 사용하지 않고 Spring Bean을 사용하면 왜 객체지향 적개발이 될까??.. 2024. 2. 15.