Giter VIP home page Giter VIP logo

flask_jwt's Introduction

flask jwt

  • 파이콘 2018 에서 flask jwt 튜토리얼 들고 실습한 코드 및 내용 정리

인증 인가 무엇이 다른것 인가

  • 인증 : 로그인 같이 사용자임을 확인
  • 인가 : 해당 사용자가 API 사용을 위한 권한을 갖는지 확인

왜 jwt

  • 랜덤 토큰은 해당 사용자 정보를 얻기 위해 DB 혹은 인증 서버를 태워야함
  • 이로 인한 추가적인 오버해드 발생
  • 차라리 토큰에 점보를 json 형태로 심음 으로 해당 비용을 줄임

jwt 필드

  • iss : 토큰 발행자
  • exp : 토큰 만료일
  • sub : 뭔지 기억이....
  • scope : 튜토리얼 진행하신 분이 쓰는 필드, 어디 가지 볼 수 있는지 알려줌(권한)

인증 방식

  • RBAC : 인가에 대한 구현

jwt 사용시 고려사항

  • 보안 이슈
  • 쿠키에 저장 -> xss 공격 방지
  • 쿠키에 저장할 경우 csrf 에 대해 방어 해야함
    • 우리가 모르는 도메인에서 요청이 올 수 있음
  • 공개키를 사용 하는 것도 좋음
  • 민감한 데이터는 payload 에 넣으면 안됨
    • 토큰이 탈취 될 것을 가정해야함
  • 토큰의 유효시간을 짧게 할 수 록 좋음
  • 서비스 요청을 하다가 토큰을 만료 됐을 경우, access_token 길게 가져감
    • 인증 DB를 거치는 것을 권장

flask_jwt's People

Contributors

rkdgusrnrlrl avatar

Stargazers

EvanJin 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.