JWT

정은경·2020년 3월 13일
0

IT Terms

목록 보기
13/22

JWT (JSON Web Tokens)

  • JSON Web Token (JWT) 은 웹표준 (RFC 7519) 으로서 두 개체에서 JSON 객체를 사용하여 가볍고 자가수용적인 (self-contained) 방식으로 정보를 안전성 있게 전달해줌
    *JWT의 구조

python에서 jwt 생성하기

import jwt
import bcrypt
a = jwt.encode({'id':'1'}, '123456', algorithm='HS256')
a.decode('utf-8')
jwt.decode(a, '123456', algorithm='HS256')
c = bcrypt.hashpw('12345'.encode(), bcrypt.gensalt()).decode('utf-8')
d = bcrypt.hashpw('1234666'.encode(), bcrypt.gensalt()).decode('utf-8')
bcrypt.checkpw('1234666'.encode(), d.encode())![](https://velog.velcdn.com/images%2Fmuchogusto%2Fpost%2F1987901b-3c57-4deb-b313-9313716f82cd%2Fimage.png)

JWT를 활용하여 이상적인 Scalable한 인증서버를 만들려고 하고자 할때 어떻게 구성을 할 것인가?

  • 토큰을 사용한다!

Reference

profile
#의식의흐름 #순간순간 #생각의스냅샷

0개의 댓글