Skip to content

Commit

Permalink
Return raw id token, also fix hanging issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rayluo committed Jun 7, 2022
1 parent 389042f commit 5555e9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions msal/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def _convert_result(result, client_id, expected_token_type=None): # Mimic an on
return_value = {k: v for k, v in {
"access_token": result.get_access_token(),
"expires_in": result.get_access_token_expiry_time(),
"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(),
"_account_id": account.get_account_id(),
Expand Down Expand Up @@ -162,6 +163,9 @@ def _signin_interactively(
logger.warning("Using both select_account and login_hint is ambiguous. Ignoring login_hint.")
else:
logger.warning("prompt=%s is not supported by this module", prompt)
if not window:
# This fixes account picker hanging in IDE debug mode on some machines
params.set_additional_parameter("msal_gui_thread", "true") # Since pymsalruntime 0.8.1
if enable_msa_pt:
_enable_msa_pt(params)
for k, v in kwargs.items(): # This can be used to support domain_hint, max_age, etc.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
# The broker is defined as optional dependency,
# so that downstream apps can opt in. The opt-in is needed, partially because
# most existing MSAL Python apps do not have the redirect_uri needed by broker.
"pymsalruntime>=0.8,<0.9;python_version>='3.6' and platform_system=='Windows'",
"pymsalruntime>=0.8.1,<0.9;python_version>='3.6' and platform_system=='Windows'",
],
},
)
Expand Down

0 comments on commit 5555e9d

Please sign in to comment.