Skip to content

Commit

Permalink
Convert PyMsalRuntime's expiry epoch to a count-down value
Browse files Browse the repository at this point in the history
  • Loading branch information
rayluo committed Jun 29, 2022
1 parent 1f031e8 commit 46ef0e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion msal/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from threading import Event
import json
import logging
import time
import uuid


Expand Down Expand Up @@ -91,7 +92,7 @@ def _convert_result(result, client_id, expected_token_type=None): # Mimic an on
#account.get_account_property("wam_account_ids")
return_value = {k: v for k, v in {
"access_token": result.get_access_token(),
"expires_in": result.get_access_token_expiry_time(),
"expires_in": result.get_access_token_expiry_time() - int(time.time()), # Convert epoch to count-down
"id_token": result.get_raw_id_token(), # New in pymsalruntime 0.8.1
"id_token_claims": id_token_claims,
"client_info": account.get_client_info(),
Expand Down

0 comments on commit 46ef0e5

Please sign in to comment.