💻
Albert's Til
GitHub
  • 매일매일 조금씩 성장하기
    • README
    • CS
      • Network
      • HTTP
        • NO-CACHE
      • 오류 코드
      • ORM 도구
      • Design Pattern
        • CQRS Pattern
          • Event Sourcing and CQRS pattern
        • Builder Pattern
    • DB
      • MySQL
        • Timeline
        • Pagination
        • Index
        • Database Performance Optimization Strategies
        • B+ tree
        • MySQL Connectors VS MySQL Shell(Scripting) VS MySQL Workbench
        • MySQL Storage Engine Architecture
      • Normalization & Denormalization
      • JPA
        • @Transactional
        • Why JPA?
        • About JPA
        • N+1 Issue
        • Index
        • ElementCollection&CollectionTable
        • orphanRemoval
        • CascadeType
        • Use Subselect
        • Dynamic Instance Creation
        • Paging
        • Order
        • Spefication
        • mappedBy
      • MongoDB
        • ObjectId
      • Why MySQL?
      • ACID properties of transactions
      • Between JPA and JDBC
      • Identifiers in Hibernate/JPA
    • Java
      • Jackson de/serialize
      • Collections.singletonList() vs List.of()
      • Manage dependencies in Gradle
      • Logging Level
      • Bean Validation
      • JVM Internals
        • Threads
          • Frame
        • Shared Between Threads
          • Classloader
            • Class Loader Hierarchy
            • Loading Linking Initialization
      • Java Collection Framework
      • Annotation
      • Generic
      • 디미터 법칙
    • Spring
      • Caching
      • Spring Integration Overview
        • ThreadPollTaskExecutor
        • Messaging Bridge
        • Channel Adapter
        • Poller
        • Configuration and @EnableIntegration
        • Message Endpoints
        • Message Channels
      • HATEOAS
      • @Autowired vs Constructor Dependency Injection
      • Spring Security
        • JWT 토큰 사용한 인가
        • OAuth 2 Login
        • OAuth 2 인증
        • 인가
        • 인증
        • PasswordEncoder
      • IoC Container
      • Filter,Interceptor,AOP,Argument Resolver
      • Spring Annotation
      • About Spring
    • Kafka
      • Error Channel
    • Infra
      • Scale Up || Scale Out
      • Docker
        • Dockerfile
        • Docker Hub Deploy
        • Command
      • Cloud 유형
        • Infrastructure as a Service
        • Platform as a Service
        • Software as a Service
      • 무중단 배포
        • 엔진엑스(Nginx)
      • 코드 자동 배포
        • Technical
      • AWS EC2
        • PEM(Privacy Enhanced Mail) 키
      • AWS RDS
      • AWS S3
    • CodeSquad
      • Spring Boot Project 1주차 회고
      • Spring Boot Project 2주차 회고
      • Spirng Boot Project 3주차 회고
      • Spring Boot Project 4주차 회고
    • Foody Moody 프로젝트
      • Query Performance Comparison
      • HeartCount Asynchronous Issue
      • DeferredResult
      • ResponseBodyEmitter
      • SseEmitter (Spring)
      • Server-Sent Events (SSE)
      • 기술 스택 적용 이유
      • NO-CACHE(HTTP)
      • Transactional
    • DDD
      • AggregateId
    • Test
      • RestAssured
    • Coding and Algorithmic Problems
      • 819. Most Common Word
      • 344. Reverse String
      • 125. Valid Palindrome
      • 937. Reorder Data in Log Files
    • Node
      • Async... Await...
      • Custom Transactional Decorator Challenger
    • Python
      • Python Basic Grammar
        • Comments and Input/Output
        • Variable
        • Data type
        • Operations and syntax
        • List,Tuple,Dictionary,Set
        • Function
        • Conditional statement
        • Loop
    • HTML
      • HTML Basic
      • HTML Basic Tags
      • HTML Form Tags
      • HTML Table Tags
    • CSS
      • CSS Basic
      • CSS Practice
Powered by GitBook
On this page
  • 상황
  • 내가 느끼는 문제
  • 문제를 해결할 수 있는 방법
  • 내가 선택한 방법과 이유
  • 결과

Was this helpful?

  1. 매일매일 조금씩 성장하기
  2. Spring
  3. Spring Security

JWT 토큰 사용한 인가

상황

  • 팀 프로젝트에서 사용자 인증과 인가 구현을 담당하게 하게 되였습니다.

내가 느끼는 문제

  • 인증과 인가의 분리 필요성: 인증(Authentication)과 인가(Authorization)는 별도의 과정으로 관리되어야 합니다. 이는 각 과정의 명확한 역할 분담과 효율적인 관리를 위해 필요합니다.

  • 제3자 OAuth 토큰 관리의 어려움: OAuth 토큰을 사용한 인증은 제3자 서비스와의 통합 때문에 관리가 복잡해진다.

문제를 해결할 수 있는 방법

  1. OAuth2 인증 후 바로 인가: 사용자가 OAuth2를 통해 인증을 완료한 후에 즉시 인가 과정을 수행합니다.

  2. JWT 토큰을 통한 인가: 인증된 사용자에게 JWT 토큰을 발급하여 그들의 권한을 관리하고, 리소스 접근을 허가합니다.

내가 선택한 방법과 이유

  • 선택한 방법: Spring OAuth2와 JWT 토큰을 결합한 인증 및 인가 시스템

  • 이유:

    • 분리된 관리: 인증과 인가를 분리함으로써 각각의 과정을 보다 효율적으로 관리할 수 있습니다.

    • 보안성 강화: Spring OAuth2는 안전한 인증 방법을 제공하고, JWT는 인가 과정에서 필요한 정보를 안전하게 전송하며 보안성을 강화합니다

결과

  • 효율적인 인증 및 인가 처리: 사용자 인증은 Spring OAuth2를 통해 안전하게 이루어지며, 인가 과정은 JWT 토큰을 사용하여 유연하게 관리됩니다. 이로써, 인증 및 인가 과정의 효율성이 향상되었습니다.

Last updated 1 year ago

Was this helpful?