Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
More PR feedback
  • Loading branch information
sgonzalezMSFT committed Dec 16, 2019
commit 15a0ff4fb2811b3ce535de0a90140a8c8136afb2
2 changes: 1 addition & 1 deletion msal/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def acquire_token_by_authorization_code(
scope=decorate_scope(scopes, self.client_id)),
headers={'client-request-id': _get_new_correlation_id(),
'x-client-current-telemetry': _build_current_telemetry_request_header(
self.ACQUIRE_TOKEN_BY_AUTHORIZATION_CODE_ID)},
self.ACQUIRE_TOKEN_BY_AUTHORIZATION_CODE_ID)},
**kwargs)

def get_accounts(self, username=None):
Expand Down
2 changes: 1 addition & 1 deletion msal/authority.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, authority_url, validate_authority=True,
_, _, self.tenant = canonicalize(self.token_endpoint) # Usually a GUID
self.is_adfs = self.tenant.lower() == 'adfs'

def user_realm_discovery(self, username, correlation_id, response=None):
def user_realm_discovery(self, username, correlation_id=None, response=None):
# It will typically return a dict containing "ver", "account_type",
# "federation_protocol", "cloud_audience_urn",
# "federation_metadata_url", "federation_active_auth_url", etc.
Expand Down
3 changes: 1 addition & 2 deletions tests/test_authority.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,11 @@ def test_memorize(self):
# We now pretend this authority supports no User Realm Discovery
class MockResponse(object):
status_code = 404
a.user_realm_discovery("[email protected]", "ecbecaf4-1759-498d-ae24-25a98a8eca27", response=MockResponse())
a.user_realm_discovery("[email protected]", response=MockResponse())
self.assertIn(
"login.microsoftonline.com",
Authority._domains_without_user_realm_discovery,
"user_realm_discovery() should memorize domains not supporting URD")
a.user_realm_discovery("[email protected]",
"ecbecaf4-1759-498d-ae24-25a98a8eca27",
response="This would cause exception if memorization did not work")