From 2c79aaba9facfb5c36b30570a17bcdecd145f334 Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Mon, 14 Nov 2022 14:51:50 -0800 Subject: [PATCH] Switch to new region endpoints --- msal/application.py | 2 +- tests/test_e2e.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/msal/application.py b/msal/application.py index 916f7170..b469c350 100644 --- a/msal/application.py +++ b/msal/application.py @@ -622,7 +622,7 @@ def _get_regional_authority(self, central_authority): else self._region_configured) # It will retain the None i.e. opted out logger.debug('Region to be used: {}'.format(repr(region_to_use))) if region_to_use: - regional_host = ("{}.r.login.microsoftonline.com".format(region_to_use) + regional_host = ("{}.login.microsoft.com".format(region_to_use) if central_authority.instance in ( # The list came from point 3 of the algorithm section in this internal doc # https://identitydivision.visualstudio.com/DevEx/_git/AuthLibrariesApiReview?path=/PinAuthToRegion/AAD%20SDK%20Proposal%20to%20Pin%20Auth%20to%20region.md&anchor=algorithm&_a=preview diff --git a/tests/test_e2e.py b/tests/test_e2e.py index cd3ee467..ae3683e5 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -904,7 +904,7 @@ def _test_acquire_token_for_client(self, configured_region, expected_region): self.app.http_client, "post", return_value=MinimalResponse( status_code=400, text='{"error": "mock"}')) as mocked_method: self.app.acquire_token_for_client(scopes) - expected_host = '{}.r.login.microsoftonline.com'.format( + expected_host = '{}.login.microsoft.com'.format( expected_region) if expected_region else 'login.microsoftonline.com' mocked_method.assert_called_with( 'https://{}/{}/oauth2/v2.0/token'.format(