Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion msal/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ def acquire_token_on_behalf_of(self, user_assertion, scopes, claims_challenge=No
The claims_challenge parameter requests specific claims requested by the resource provider
in the form of a claims_challenge directive in the www-authenticate header to be
returned from the UserInfo Endpoint and/or in the ID Token and/or Access Token.
It is a string of a JSON object which contains lists of claims being requested from these locations..
It is a string of a JSON object which contains lists of claims being requested from these locations.

:return: A dict representing the json response from AAD:

Expand Down
12 changes: 6 additions & 6 deletions tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,23 +272,23 @@ def helper(scopes, account, authority, *args, **kwargs):
class TestApplicationForClientCapabilities(unittest.TestCase):

def test_capabilities_and_id_token_claims_merge(self):
client_capabilities = ["llt", "ssm"]
client_capabilities = ["foo", "bar"]
claims_challenge = '''{"id_token": {"auth_time": {"essential": true}}}'''
merged_claims = '''{"id_token": {"auth_time": {"essential": true}},
"access_token": {"xms_cc": {"values": ["llt", "ssm"]}}}'''
"access_token": {"xms_cc": {"values": ["foo", "bar"]}}}'''
# Comparing dictionaries as JSON object order differs based on python version
self.assertEqual(
json.loads(merged_claims),
json.loads(_merge_claims_challenge_and_capabilities(
client_capabilities, claims_challenge)))

def test_capabilities_and_id_token_claims_and_access_token_claims_merge(self):
client_capabilities = ["llt", "ssm"]
client_capabilities = ["foo", "bar"]
claims_challenge = '''{"id_token": {"auth_time": {"essential": true}},
"access_token": {"nbf":{"essential":true, "value":"1563308371"}}}'''
merged_claims = '''{"id_token": {"auth_time": {"essential": true}},
"access_token": {"nbf": {"essential": true, "value": "1563308371"},
"xms_cc": {"values": ["llt", "ssm"]}}}'''
"xms_cc": {"values": ["foo", "bar"]}}}'''
# Comparing dictionaries as JSON object order differs based on python version
self.assertEqual(
json.loads(merged_claims),
Expand All @@ -302,8 +302,8 @@ def test_no_capabilities_only_claims_merge(self):
json.loads(_merge_claims_challenge_and_capabilities(None, claims_challenge)))

def test_only_client_capabilities_no_claims_merge(self):
client_capabilities = ["llt", "ssm"]
merged_claims = '''{"access_token": {"xms_cc": {"values": ["llt", "ssm"]}}}'''
client_capabilities = ["foo", "bar"]
merged_claims = '''{"access_token": {"xms_cc": {"values": ["foo", "bar"]}}}'''
self.assertEqual(
json.loads(merged_claims),
json.loads(_merge_claims_challenge_and_capabilities(client_capabilities, None)))
Expand Down