Skip to content

Commit ede91cd

Browse files
committed
Workaround for PyMsalRuntime's expiry time
1 parent 1f031e8 commit ede91cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

msal/broker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from threading import Event
55
import json
66
import logging
7+
import time
78
import uuid
89

910

@@ -91,7 +92,9 @@ def _convert_result(result, client_id, expected_token_type=None): # Mimic an on
9192
#account.get_account_property("wam_account_ids")
9293
return_value = {k: v for k, v in {
9394
"access_token": result.get_access_token(),
94-
"expires_in": result.get_access_token_expiry_time(),
95+
"expires_in":
96+
result.get_access_token_expiry_time() # As of pymsalruntime 0.9, it returns an epoch
97+
- int(time.time()),
9598
"id_token": result.get_raw_id_token(), # New in pymsalruntime 0.8.1
9699
"id_token_claims": id_token_claims,
97100
"client_info": account.get_client_info(),

0 commit comments

Comments
 (0)