Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit b9fd4bc

Browse files
authored
Merge pull request #227 from zakramer/patch-2
Removal of login.windows.net / login-us
2 parents b65cdce + 1b8eac1 commit b9fd4bc

File tree

10 files changed

+13
-15
lines changed

10 files changed

+13
-15
lines changed

adal/authentication_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self, authorization_uri, resource):
5353
# The 401 challenge is a standard defined in RFC6750, which is based in part on RFC2617.
5454
# The challenge has the following form.
5555
# WWW-Authenticate : Bearer
56-
# authorization_uri="https://login.windows.net/mytenant.com/oauth2/authorize",
56+
# authorization_uri="https://login.microsoftonline.com/mytenant.com/oauth2/authorize",
5757
# Resource_id="00000002-0000-0000-c000-000000000000"
5858

5959
# This regex is used to validate the structure of the challenge header.

adal/constants.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,11 @@ class HttpError(object):
208208

209209
class AADConstants(object):
210210

211-
WORLD_WIDE_AUTHORITY = 'login.windows.net'
211+
WORLD_WIDE_AUTHORITY = 'login.microsoftonline.com'
212212
WELL_KNOWN_AUTHORITY_HOSTS = [
213213
'login.windows.net',
214214
'login.microsoftonline.com',
215215
'login.chinacloudapi.cn',
216-
'login-us.microsoftonline.com',
217216
'login.microsoftonline.us',
218217
'login.microsoftonline.de',
219218
]

adal/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def scrub_pii(arg_dict, padding="..."):
151151
"redirect_uri",
152152

153153
# Unintuitively, the following can contain PII
154-
"user_realm_url", # e.g. https://login.windows.net/common/UserRealm/{username}
154+
"user_realm_url", # e.g. https://login.microsoftonline.com/common/UserRealm/{username}
155155
])
156156
return {k: padding if k.lower() in pii else arg_dict[k] for k in arg_dict}
157157

sample/website_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
raise ValueError('Please provide parameter file with account information.')
5050

5151
PORT = 8088
52-
TEMPLATE_AUTHZ_URL = ('https://login.windows.net/{}/oauth2/authorize?'+
52+
TEMPLATE_AUTHZ_URL = ('https://login.microsoftonline.com/{}/oauth2/authorize?'+
5353
'response_type=code&client_id={}&redirect_uri={}&'+
5454
'state={}&resource={}')
5555
GRAPH_RESOURCE = '00000002-0000-0000-c000-000000000000'

tests/config_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"password" : "None",
4343
"tenant" : "XXXXXXXX.onmicrosoft.com",
4444

45-
"authorityHostUrl" : "https://login.windows.net",
45+
"authorityHostUrl" : "https://login.microsoftonline.com",
4646
}
4747

4848
ACQUIRE_TOKEN_WITH_CLIENT_CREDENTIALS = {

tests/test_api_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_api_version_default_value(self):
4444
with warnings.catch_warnings(record=True) as caught_warnings:
4545
warnings.simplefilter("always")
4646
context = adal.AuthenticationContext(
47-
"https://login.windows.net/tenant")
47+
"https://login.microsoftonline.com/tenant")
4848
self.assertEqual(context._call_context['api_version'], None)
4949
self.assertEqual(len(caught_warnings), 0)
5050
if len(caught_warnings) == 1:
@@ -57,7 +57,7 @@ def test_explicitly_turn_off_api_version(self):
5757
with warnings.catch_warnings(record=True) as caught_warnings:
5858
warnings.simplefilter("always")
5959
context = adal.AuthenticationContext(
60-
"https://login.windows.net/tenant", api_version=None)
60+
"https://login.microsoftonline.com/tenant", api_version=None)
6161
self.assertEqual(context._call_context['api_version'], None)
6262
self.assertEqual(len(caught_warnings), 0)
6363

tests/test_authority.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ def performStaticInstanceDiscovery(self, authorityHost):
123123
def test_success_static_instance_discovery(self):
124124

125125
self.performStaticInstanceDiscovery('login.microsoftonline.com')
126-
self.performStaticInstanceDiscovery('login.windows.net')
127126
self.performStaticInstanceDiscovery('login.chinacloudapi.cn')
128-
self.performStaticInstanceDiscovery('login-us.microsoftonline.com')
127+
self.performStaticInstanceDiscovery('login.microsoftonline.us')
129128
self.performStaticInstanceDiscovery('test-dsts.dsts.core.windows.net')
130129
self.performStaticInstanceDiscovery('test-dsts.dsts.core.chinacloudapi.cn')
131130
self.performStaticInstanceDiscovery('test-dsts.dsts.core.cloudapi.de')

tests/test_self_signed_jwt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class TestSelfSignedJwt(unittest.TestCase):
5656
expectedJwtWithPublicCert = cp['expectedJwtWithPublicCert']
5757

5858
unexpectedJwt = 'unexpectedJwt'
59-
testAuthority = Authority('https://login.windows.net/naturalcauses.com', False)
59+
testAuthority = Authority('https://login.microsoftonline.com/naturalcauses.com', False)
6060
testClientId = 'd6835713-b745-48d1-bb62-7a8248477d35'
6161
testCert = cp['cert']
6262
testPublicCert=cp['publicCert']

tests/test_user_realm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
class TestUserRealm(unittest.TestCase):
5353

5454
def setUp(self):
55-
self.authority = 'https://login.windows.net'
55+
self.authority = 'https://login.microsoftonline.com'
5656
self.user = 'test@federatedtenant-com'
5757

5858
user_realm_path = cp['userRealmPathTemplate'].replace('<user>', quote(self.user, safe='~()*!.\''))

tests/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@
122122
'clientId': 'clien&&???tId',
123123
'clientSecret': 'clientSecret*&^(?&',
124124
'resource': '00000002-0000-0000-c000-000000000000',
125-
'evoEndpoint': 'https://login.windows.net/',
125+
'evoEndpoint': 'https://login.microsoftonline.com/',
126126
'username': '[email protected]',
127127
'password': '<password>',
128128
'authorityHosts': {
129-
'global': 'login.windows.net',
129+
'global': 'login.microsoftonline.com',
130130
'china': 'login.chinacloudapi.cn',
131-
'gov': 'login-us.microsoftonline.com'
131+
'gov': 'login.microsoftonline.us'
132132
}
133133
}
134134

0 commit comments

Comments
 (0)