Added JWT nbf, not before
This commit is contained in:
parent
e9367b03be
commit
1f618c8f41
|
@ -129,6 +129,12 @@ class JWTTokenApi(BasePlugin):
|
||||||
|
|
||||||
parsed = json.loads(token.claims)
|
parsed = json.loads(token.claims)
|
||||||
|
|
||||||
|
if 'nbf' in parsed:
|
||||||
|
# Not Before is present, so we need to check it
|
||||||
|
if time.time() < parsed['nbf']:
|
||||||
|
print('Token can not be used yet!', file=sys.stderr)
|
||||||
|
return None
|
||||||
|
|
||||||
if 'exp' in parsed:
|
if 'exp' in parsed:
|
||||||
# Expiration time is present, so we need to check it
|
# Expiration time is present, so we need to check it
|
||||||
if time.time() > parsed['exp']:
|
if time.time() > parsed['exp']:
|
||||||
|
|
Loading…
Reference in New Issue