Spring/Spring Security
-
oauth2 자세한 플로우 체크Spring/Spring Security 2025. 8. 21. 16:03
타임라인 (끝까지 한번에)사전 설정 — 인가 서버(AS)에서 클라이언트 등록client_id, client_secret(백엔드는 비공개 클라이언트), redirect_uri=https://api.example.com/oauth/callback 등록.PKCE: 비공개 클라이언트라도 켜도 됨(권장) → requireProofKey=true, S256.(켜두면 코드 탈취 방어층 추가. 자세한 관여 지점은 2), 5) 참고)프론트 → 백엔드: 로그인 시작프론트가 GET /auth/login 호출.백엔드는 state, nonce (그리고 PKCE를 사용할 거면 code_verifier 생성 & code_challenge 계산)를 서버 세션에 저장.백엔드 → 인가 서버: /authorize로 리다이렉트 (PKCE ..
-
vsCode 커스텀 oauth2 이론Spring/Spring Security 2025. 8. 12. 15:55
OAuth2 용어 정리Resource Owner (사용자): 실제 계정/데이터를 가진 사람. (예: 구글 계정을 가진 사용자)Authorization Server (인가 서버): 로그인/토큰 발급 담당. (예: Google Identity, Keycloak, Auth0)Client (클라이언트 애플리케이션): 사용자 대신 인가 서버와 상호작용해서 토큰을 얻는 앱.웹 애플리케이션 (백엔드 서버)SPA(React, Vue 같은 브라우저 앱)모바일 앱데스크톱 앱Resource Server (API 서버): 액세스 토큰을 검증하고 실제 자원(API)을 제공하는 서버. 전체 플로우 (요청 → 저장 → 구글 → 콜백 → 토큰교환 → 성공핸들러)아래는 래퍼 방식( /auth/start/google ) 기준으로, 실제..
-
공통 Session server 와 JWT를 이용한 로그인 구현 with spring security multimodule,spring boot ,redis - 1Spring/Spring Security 2024. 4. 9. 17:07
Contents 시작에 앞서 파일구조 shared-session-server/ │ ├── session-server/ │ ├── src/ │ │ ├── main/ │ │ │ ├── java/ │ │ │ │ ├── com/ │ │ │ │ │ ├── sessionserver/ │ │ │ │ │ │ ├── config/ │ │ │ │ │ │ │ ├── SecurityConfig.java │ │ │ │ │ │ │ ├── RedisConfig.java │ │ │ │ │ │ │ ├── JwtTokenUtil.java │ │ │ │ │ │ │ ├── JwtAuthenticationFilter.java │ │ │ │ │ │ ├── controller/ │ │ │ │ │ │ │ ├── AuthController.java..
-
[Spring Security에 대한 이해]인증 공급자 (Authentication Provider)(UserDetailsService,UserDetails,GrantedAuthority,UserDetailsManager) - 2Spring/Spring Security 2023. 2. 17. 09:18
Contents --> Authentication Provider (인증 공급자) 역할 @Componentpublic class CustomAuthenticationProvider[CA]implements AuthenticationProvider { @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { // authentication logic here } @Override public boolean supports(Class authenticationType) { // type of the Authentication i..
-
[Spring Security에 대한 이해] 기본 구성 - 1Spring/Spring Security 2023. 2. 16. 18:54
1.Spring Security 기본 동작 구성 - 기본적으로 Spring Security는 위와같은 구성으로 동작한다. 각각에 대한 요소에 대한 설명은 아래와 같다. 인증 필터 : 인증 요청을 인증 관리자에 위임하고 , 응답을 바탕으로 보안 컨텍스트를 구성한다. 인증 관리자 : 인증 공급자를 이용해 인증을 처리한다. 인증 공급자 : 인증 논리를 구현 , 사용자 관리 책임을 구현하는 사용자 세부 정보 서비스를 인증 논리에 이용한다. 또한 암호 관리를 구현하는 암호 인코더를 인증 논리에 이용한다. 보안 컨텍스트는 인증 프로세스 후 인증 데이터를 유지한다.