diff --git a/websockify/token_plugins.py b/websockify/token_plugins.py index 80a9568..dab1982 100644 --- a/websockify/token_plugins.py +++ b/websockify/token_plugins.py @@ -129,6 +129,12 @@ class JWTTokenApi(BasePlugin): 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: # Expiration time is present, so we need to check it if time.time() > parsed['exp']: