10from datetime
import datetime, timedelta
15filename =
"./cdb_token"
17validity = timedelta(hours=1)
18secret = getpass.getpass(
"JWT Secret: ")
22 "name":
"Dr. Test User",
23 "b2cdb:admin": [f
"user_{username}_.*",
"staging_online",
"online"],
24 "b2cdb:create_iov": [
"test_creation.*"],
25 "exp": datetime.utcnow() + validity
28with open(filename,
"bw")
as f:
29 token = jwt.encode(payload, secret)
30 f.write(token.encode(
'utf8'))