|
7 | 7 | from oidcmsg.message import OPTIONAL_LIST_OF_STRINGS |
8 | 8 | from oidcmsg.message import SINGLE_OPTIONAL_STRING |
9 | 9 | from oidcmsg.message import SINGLE_REQUIRED_STRING |
10 | | -from oidcmsg.message import SINGLE_OPTIONAL_JSON |
11 | 10 | from oidcmsg.message import msg_ser |
12 | 11 | from oidcmsg.oidc import AuthorizationRequest |
| 12 | +from oidcmsg.time_util import utc_time_sans_frac |
13 | 13 |
|
14 | 14 | from oidcendpoint import token_handler |
15 | 15 | from oidcendpoint.authn_event import AuthnEvent |
16 | 16 | from oidcendpoint.in_memory_db import InMemoryDataBase |
17 | | -from oidcendpoint.sso_db import SSODb, KEY_FORMAT |
18 | | -from oidcendpoint.token_handler import AccessCodeUsed |
| 17 | +from oidcendpoint.sso_db import KEY_FORMAT |
| 18 | +from oidcendpoint.sso_db import SSODb |
19 | 19 | from oidcendpoint.token_handler import ExpiredToken |
20 | 20 | from oidcendpoint.token_handler import UnknownToken |
21 | 21 | from oidcendpoint.token_handler import WrongTokenType |
@@ -48,7 +48,7 @@ def authn_event_deser(val, sformat="urlencoded"): |
48 | 48 |
|
49 | 49 |
|
50 | 50 | def setup_session( |
51 | | - endpoint_context, areq, uid, client_id="", acr="", salt="salt", authn_event=None |
| 51 | + endpoint_context, areq, uid, client_id="", acr="", salt="salt", authn_event=None |
52 | 52 | ): |
53 | 53 | """ |
54 | 54 | Setting up a user session |
@@ -250,7 +250,7 @@ def get_token(self, sid): |
250 | 250 | return _sess_info["access_token"] |
251 | 251 |
|
252 | 252 | def do_sub( |
253 | | - self, sid, uid, client_salt, sector_id="", subject_type="public", user_salt="" |
| 253 | + self, sid, uid, client_salt, sector_id="", subject_type="public", user_salt="" |
254 | 254 | ): |
255 | 255 | """ |
256 | 256 | Create and store a subject identifier |
@@ -319,13 +319,13 @@ def _make_at(self, sid, session_info, aud=None, client_id_aud=True): |
319 | 319 | ) |
320 | 320 |
|
321 | 321 | def upgrade_to_token( |
322 | | - self, |
323 | | - grant=None, |
324 | | - issue_refresh=False, |
325 | | - id_token="", |
326 | | - oidreq=None, |
327 | | - key=None, |
328 | | - scope=None, |
| 322 | + self, |
| 323 | + grant=None, |
| 324 | + issue_refresh=False, |
| 325 | + id_token="", |
| 326 | + oidreq=None, |
| 327 | + key=None, |
| 328 | + scope=None, |
329 | 329 | ): |
330 | 330 | """ |
331 | 331 |
|
@@ -365,6 +365,8 @@ def upgrade_to_token( |
365 | 365 |
|
366 | 366 | if self.handler["access_token"].lifetime: |
367 | 367 | session_info["expires_in"] = self.handler["access_token"].lifetime |
| 368 | + session_info["expires_at"] = self.handler[ |
| 369 | + "access_token"].lifetime + utc_time_sans_frac() |
368 | 370 |
|
369 | 371 | if issue_refresh: |
370 | 372 | session_info = self.replace_token(key, session_info, "refresh_token") |
|
0 commit comments