This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
import hashlib | |
import base64 | |
import json | |
import datetime | |
secret_key = '52d3f853c19f8b63c0918c126422aa2d99b1aef33ec63d41dea4fadf19406e54' | |
def create_jwt(payload): | |
payload = json.dumps(payload).encode() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
import hashlib | |
import base64 | |
import json | |
secret_key = '52d3f853c19f8b63c0918c126422aa2d99b1aef33ec63d41dea4fadf19406e54' | |
JWT = 'eyJ0eXAiOiAiSldUIiwgImFsZyI6ICJIUzI1NiJ9.eyJ1c2VySWQiOiAiNTUzOTU0MjctMjY1YS00MTY2LWFjOTMtZGE2ODc5ZWRiNTdhIiwgImV4cCI6IDE1NTY4NDE2MDB9.09Rcd_IMo9dDVi0kJGeCpgS-YeTKtUxmMvHO1QnLC5c=' | |
b64_header, b64_payload, b64_signature = JWT.split('.') | |
b64_signature_checker = base64.urlsafe_b64encode( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
import hashlib | |
import base64 | |
import json | |
secret_key = '52d3f853c19f8b63c0918c126422aa2d99b1aef33ec63d41dea4fadf19406e54' | |
header = json.dumps({ | |
'typ': 'JWT', | |
'alg': 'HS256' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header = { | |
"typ": "JWT", | |
"alg": "HS256" | |
} | |
payload = { | |
"userId": "55395427-265a-4166-ac93-da6879edb57a", | |
"exp": 1556841600 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"userId": "55395427-265a-4166-ac93-da6879edb57a", | |
"exp": 1556841600 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"typ": "JWT", | |
"alg": "HS256" | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.