Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit f478307

Browse files
committed
fix: userinfo endpoint authn timestamp event comparison
1 parent a2e76e3 commit f478307

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/oidcop/oidc/userinfo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import logging
3+
from datetime import datetime
34
from typing import Callable
45
from typing import Optional
56
from typing import Union
@@ -127,12 +128,11 @@ def process_request(self, request=None, **kwargs):
127128
allowed = True
128129
_auth_event = _grant.authentication_event
129130
# if the authenticate is still active or offline_access is granted.
130-
if _auth_event["valid_until"] > utc_time_sans_frac():
131-
pass
132-
else:
131+
if not _auth_event["valid_until"] >= utc_time_sans_frac():
133132
logger.debug(
134133
"authentication not valid: {} > {}".format(
135-
_auth_event["valid_until"], utc_time_sans_frac()
134+
datetime.fromtimestamp(_auth_event["valid_until"]),
135+
datetime.fromtimestamp(utc_time_sans_frac())
136136
)
137137
)
138138
allowed = False

0 commit comments

Comments
 (0)