Spring5 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. [토비의 스프링] 스프링의 이해와 원리 스프링이란 어떻게 오브젝트가 설계되고, 만들어지고, 어떻게 관계를 맺고 사용되는지에 관심을 갖는 프레임워크 - 143p 프로그래밍 모델 스프링이 제공하는 편리함은 객체지향 설계 원칙과 디자인 패턴의 핵심 원리를 갖고 있는 IoC/DI에서 온다. 또한 AOP를 이용하여 독립적으로 모듈화 할 수 있다. 왜 스프링이여야만 할까 싱글톤의 장점을 빼내오고자 추상 클래스의 중복 멤버 통합과 인터페이스의 다중 상속기능을 동시에 이용할 수 있다. 이 을 같이 사용하는 여러가지 코드 패턴들이 나왔고, 이것이 디자인 패턴의 근간이 될 수 있다. 1. 싱글톤 패턴 메모리 절약을 위해, 인스턴스가 필요할 때 똑같은 인스턴스를 새로 만들지 않고 기존의 인스턴스를 가져와 활용하는 기법을 말한다. 싱글콘 클래스는 고정된 메모리 영.. 2024. 3. 23. 이전 1 2 다음