Giter Club home page Giter Club logo

jwt's Introduction

Spring Security 6 + JWT

JWT 사용시 발생하는 이슈

  • 토큰 탈취의 문제

JWT를 사용하는이유

  • 유저를 인증하고 식별하기 위한 Json Web Token
  • JWT와 세션의 가장큰 차이점은 "인가"에 대한 정보를 누가 담고 있느냐이다.
  • 세션(stateful)과는 다르게 무상태(stateless)이다.
  • 모바일에서도 잘 동작한다.
    • 모바일앱의 특성상 주로 JWT 방식으로 인증/인가를 진행.
    • 장시간 로그인과 세션
  • DB 조회가 필요 없다.

JWT의 단점

  • 쿠키/세션과 다르게 토큰의 길이가 길어, 인증요청이 많아지면 네트워크 부하가 심해진다.
  • payload 자체는 암호화가 되지 않아서 중요한 정보를 담을수 없다.
  • 토큰을 탈취당하면 대처가 어렵다.(강제로 만료시키는등)
    • 이를 해결하기 위해 DB에 토큰값을 저장하는 순간 JWT의 장점인 stateless가 사라진다. 완벽한 정답은 없고 각자의 상황에 맞춰 사용하는게 답일듯 하다.

jwt's People

Contributors

choijinsil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.