목록전체 글 (81)
걸음마부터 달리기

일단 첫 스텝에서는 Access 토큰만 발급하는걸로 구현을 진행해보았다.Access 토큰이 탈취 당했을때를 대비하여 만료 시간을 짧게 잡고 Access 토큰이 만료되면 Refresh 토큰으로 재발급 받는 과정으로 가야하는데 그건 다음 스텝때... https://bestdevelop-lab.tistory.com/82 SecurityContextRepository / SecurityContextHolderFilterSecurityContextRepository 스프링 시큐리티에서 사용자가 인증 이후 요청에 대해 계속 사용자의 인증을 유지하기 위해 사용되는 클래스Repository ⇒ 인증 상태를 유지하기 위한 저장소인증 상태의 영속bestdevelop-lab.tistory.comhttps://itvillag..

ExceptionTranslationFilter 는 Security에서 발생한 인가와 인증 예외에 대해 예외처리를 수행했다.AccessDeniedException와 AutheticationException의 예외 타입에 대해서만 처리를 해준다는 것을 앞의 게시물에서 보았다. @Configuration@EnableWebSecurity@RequiredArgsConstructorpublic class WebSecurityConfig { private final JwtAuthenticationFilter jwtAuthenticationFilter; @Bean public SecurityFilterChain configure(HttpSecurity http) throws Exception {/*..

결국 스프링에서 지원하는 인증 방법은 이정도인데 가장 많이 쓰는 Username and Password 와 OAuth 2.0 Login에 대해 살펴볼려 한다.그 전에 기본 Authentication 아키텍처가 어떻게 되어있는지 확인해보자. SecurityContextHolder이 SecurityContextHolder는 스프링 시큐리티가 누가 현재 인증되었는지에 대한 디테일을 저장하고 있다.여기에 저장되어 있는 값은 곧 현재 인증된 사용자로 사용된다.즉 SecurityContextHolder는 SecurityContext가 있냐 없냐에 따라 단순하게 인증 유무로 판단하고 값이 있다면 인증된 사용자로 간주한다. 즉 우리가 할건 그냥 SecurityContextHolder에 SecurityContext를 ..

https://docs.spring.io/spring-security/reference/servlet/architecture.html Architecture :: Spring SecurityThe Security Filters are inserted into the FilterChainProxy with the SecurityFilterChain API. Those filters can be used for a number of different purposes, like authentication, authorization, exploit protection, and more. The filters are executed in a specdocs.spring.io DelegatingFilterProxy..

import java.util.*;import java.lang.*;import java.io.*;// The main method must be in a class named "Main".//2초면 2억번... N은 100, 100* 100 0000 00 / 100만까지class Main { public static void main(String[] args) throws Exception { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); int testCase = Integer.parseInt(bf.readLine()); PriorityQueue queue = new Pri..

오피셜한 정의 및 지식이 아닙니다. 단순 개발을 위해 이해한 내용으로 작성했습니다. 훅은 기본적으로 state와 관련하여 컴포넌트의 생명주기에 맞춰 호출되는 함수이다. (하지만 내가 느끼기론 이러한 정의가 맞는지 모르겠다. useNavigate 훅 경우 컴포넌트 생명주기와 관련되어 함수가 호출된다고 하기 보다는 어떤 이벤트에 맞춰서 되는거 아닌가? 싶다.) 컴포넌트가 재렌더링 하는 과정 자체가 재렌더링을 위해 "함수형 컴포넌트", 즉 함수를 다시 호출하여 해당 HTML 태그를 반환시키는 것으로 이해했다. 즉 렌더링하는 것 자체가 컴포넌트의 함수를 호출하는 것이다. 이것이 커스텀 훅과 연관이 있다고 생각한다. 생명주기와 관련해서만 수행되는 함수인 훅이 아니라, 어떤 이벤트(생명주기 관련 + 클릭같은 이벤..

현재까지의 프로젝트 진행 흐름을 좀 봐볼려고 한다. 크게 보면 이정도 Component가 있는거같다. 빨간색 원 같은 경우는 저것도 컴포넌트로 묶어야될거 같긴 한데 지금까지는 일단 냅뒀다. inputBox 컴포넌트 부터 봐보자.import React, { ChangeEvent, Dispatch, KeyboardEvent, SetStateAction, forwardRef } from "react";import './style.css'// interface : InputBox 컴포넌트의 Propertiesinterface Props { label:string; type: 'text' | 'password'; //input type placeholder:string; value: st..

import React from 'react';import ReactDOM from 'react-dom/client';import './index.css';import App from './App';import {BrowserRouter} from "react-router-dom";const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement);root.render( {/*라우팅을 진행할 컴포넌트 상위에 BrowserRouter 컴포넌트를 생성하고 감싸주어야 한다*/} );-----------------------------------------------------------..