Skip to content

Instantly share code, notes, and snippets.

@black23
Last active June 17, 2021 08:01
Show Gist options
  • Save black23/bce03ad51b39bb3394f4afa7e24cba9b to your computer and use it in GitHub Desktop.
Save black23/bce03ad51b39bb3394f4afa7e24cba9b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import datetime
import jwt # pip install pyjwt
app_id = 'SIGLA'
shared_secret = 'add_secret_here'
now = datetime.datetime.utcnow()
token_dict = dict(
iss = app_id,
iat = now,
exp = now + datetime.timedelta(seconds=3600),
app = app_id,
)
token = jwt.encode(token_dict, shared_secret, algorithm='HS256')
print(token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment