Last active
May 6, 2019 14:29
-
-
Save gustavolopess/30b1b4c3205458726efe3e7588fb666e to your computer and use it in GitHub Desktop.
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 | |
} | |
encoded_header = base64UrlEncode(header) | |
encoded_payload = base64UrlEncode(payload) | |
signature = HMACSHA256(encoded_header + '.' + encoded_payload, secret) | |
JWT = encoded_header + '.' + encoded_payload + '.' + base64UrlEncode(signature) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment