diff --git a/adal/authentication_parameters.py b/adal/authentication_parameters.py
index fa891a0..a5f97e8 100644
--- a/adal/authentication_parameters.py
+++ b/adal/authentication_parameters.py
@@ -53,7 +53,7 @@ class AuthenticationParameters(object):
 # The 401 challenge is a standard defined in RFC6750, which is based in part on RFC2617.
 # The challenge has the following form.
 # WWW-Authenticate : Bearer
-#     authorization_uri="https://login.windows.net/mytenant.com/oauth2/authorize",
+#     authorization_uri="https://login.microsoftonline.com/mytenant.com/oauth2/authorize",
 #     Resource_id="00000002-0000-0000-c000-000000000000"
 
 # This regex is used to validate the structure of the challenge header.
diff --git a/adal/constants.py b/adal/constants.py
index c92a0cf..b3aafb7 100644
--- a/adal/constants.py
+++ b/adal/constants.py
@@ -208,12 +208,11 @@ class HttpError(object):
 
 class AADConstants(object):
 
-    WORLD_WIDE_AUTHORITY = 'login.windows.net'
+    WORLD_WIDE_AUTHORITY = 'login.microsoftonline.com'
     WELL_KNOWN_AUTHORITY_HOSTS = [
         'login.windows.net',
         'login.microsoftonline.com',
         'login.chinacloudapi.cn',
-        'login-us.microsoftonline.com',
         'login.microsoftonline.us',
         'login.microsoftonline.de',
         ]
diff --git a/adal/log.py b/adal/log.py
index 4d9c59a..2973e79 100644
--- a/adal/log.py
+++ b/adal/log.py
@@ -151,7 +151,7 @@ def scrub_pii(arg_dict, padding="..."):
         "redirect_uri",
 
         # Unintuitively, the following can contain PII
-        "user_realm_url",  # e.g. https://login.windows.net/common/UserRealm/{username}
+        "user_realm_url",  # e.g. https://login.microsoftonline.com/common/UserRealm/{username}
         ])
     return {k: padding if k.lower() in pii else arg_dict[k] for k in arg_dict}
 
diff --git a/sample/website_sample.py b/sample/website_sample.py
index 438ab4d..30a7d13 100644
--- a/sample/website_sample.py
+++ b/sample/website_sample.py
@@ -49,7 +49,7 @@ else:
     raise ValueError('Please provide parameter file with account information.')
 
 PORT = 8088
-TEMPLATE_AUTHZ_URL = ('https://login.windows.net/{}/oauth2/authorize?'+
+TEMPLATE_AUTHZ_URL = ('https://login.microsoftonline.com/{}/oauth2/authorize?'+
                       'response_type=code&client_id={}&redirect_uri={}&'+
                       'state={}&resource={}')
 GRAPH_RESOURCE = '00000002-0000-0000-c000-000000000000'

Replace "login.windows.net" with "login.microsoftonline.com" in the authority host list
In here: https://github.com/AzureAD/azure-activedirectory-library-for-python/blob/2a1c7ffabda0d79548533434db0cc9bbae6eefcf/adal/constants.py#L211

ADAL is still defaulting to "login.windows.net".

MSAL has removed this endpoint long time ago, and is using "login.microsoftonline.com" as a default instead: https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/6bade9faf7c832a47b13c8ac3eeba75f4084190f/msal/authority.py#L13

Can we replace "login.windows.net" with "login.microsoftonline.com" in ADAL to be consistent with MSAL as well?


diff --git a/tests/config_sample.py b/tests/config_sample.py
index 99e946a..622a64b 100644
--- a/tests/config_sample.py
+++ b/tests/config_sample.py
@@ -42,7 +42,7 @@ ACQUIRE_TOKEN_WITH_USERNAME_PASSWORD = {
     "password" : "None",
     "tenant" : "XXXXXXXX.onmicrosoft.com",
 
-    "authorityHostUrl" : "https://login.windows.net",
+    "authorityHostUrl" : "https://login.microsoftonline.com",
 }
 
 ACQUIRE_TOKEN_WITH_CLIENT_CREDENTIALS = {
diff --git a/tests/test_api_version.py b/tests/test_api_version.py
index 2284632..285810d 100644
--- a/tests/test_api_version.py
+++ b/tests/test_api_version.py
@@ -44,7 +44,7 @@ class TestAuthenticationContextApiVersionBehavior(unittest.TestCase):
         with warnings.catch_warnings(record=True) as caught_warnings:
             warnings.simplefilter("always")
             context = adal.AuthenticationContext(
-                "https://login.windows.net/tenant")
+                "https://login.microsoftonline.com/tenant")
             self.assertEqual(context._call_context['api_version'], None)
             self.assertEqual(len(caught_warnings), 0)
             if len(caught_warnings) == 1:
@@ -57,7 +57,7 @@ class TestAuthenticationContextApiVersionBehavior(unittest.TestCase):
         with warnings.catch_warnings(record=True) as caught_warnings:
             warnings.simplefilter("always")
             context = adal.AuthenticationContext(
-                "https://login.windows.net/tenant", api_version=None)
+                "https://login.microsoftonline.com/tenant", api_version=None)
             self.assertEqual(context._call_context['api_version'], None)
             self.assertEqual(len(caught_warnings), 0)
 
diff --git a/tests/test_authority.py b/tests/test_authority.py
index 97eb418..01ac6cc 100644
--- a/tests/test_authority.py
+++ b/tests/test_authority.py
@@ -123,9 +123,8 @@ class TestAuthority(unittest.TestCase):
     def test_success_static_instance_discovery(self):
 
         self.performStaticInstanceDiscovery('login.microsoftonline.com')
-        self.performStaticInstanceDiscovery('login.windows.net')
         self.performStaticInstanceDiscovery('login.chinacloudapi.cn')
-        self.performStaticInstanceDiscovery('login-us.microsoftonline.com')
+        self.performStaticInstanceDiscovery('login.microsoftonline.us')
         self.performStaticInstanceDiscovery('test-dsts.dsts.core.windows.net')
         self.performStaticInstanceDiscovery('test-dsts.dsts.core.chinacloudapi.cn')
         self.performStaticInstanceDiscovery('test-dsts.dsts.core.cloudapi.de')
diff --git a/tests/test_self_signed_jwt.py b/tests/test_self_signed_jwt.py
index 47c2255..62bb7f9 100644
--- a/tests/test_self_signed_jwt.py
+++ b/tests/test_self_signed_jwt.py
@@ -56,7 +56,7 @@ class TestSelfSignedJwt(unittest.TestCase):
     expectedJwtWithPublicCert = cp['expectedJwtWithPublicCert']
 
     unexpectedJwt = 'unexpectedJwt'
-    testAuthority = Authority('https://login.windows.net/naturalcauses.com', False)
+    testAuthority = Authority('https://login.microsoftonline.com/naturalcauses.com', False)
     testClientId = 'd6835713-b745-48d1-bb62-7a8248477d35'
     testCert = cp['cert']
     testPublicCert=cp['publicCert']
diff --git a/tests/test_user_realm.py b/tests/test_user_realm.py
index ea98d30..2233286 100644
--- a/tests/test_user_realm.py
+++ b/tests/test_user_realm.py
@@ -52,7 +52,7 @@ from tests.util import parameters as cp
 class TestUserRealm(unittest.TestCase):
 
     def setUp(self):
-        self.authority = 'https://login.windows.net'
+        self.authority = 'https://login.microsoftonline.com'
         self.user = 'test@federatedtenant-com'
 
         user_realm_path = cp['userRealmPathTemplate'].replace('<user>', quote(self.user, safe='~()*!.\''))
diff --git a/tests/util.py b/tests/util.py
index f855df4..d5623e5 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -122,13 +122,13 @@ parameters = {
     'clientId': 'clien&&???tId',
     'clientSecret': 'clientSecret*&^(?&',
     'resource': '00000002-0000-0000-c000-000000000000',
-    'evoEndpoint': 'https://login.windows.net/',
+    'evoEndpoint': 'https://login.microsoftonline.com/',
     'username': 'rrandall@rrandallaad1.onmicrosoft.com',
     'password': '<password>',
     'authorityHosts': {
-        'global': 'login.windows.net',
+        'global': 'login.microsoftonline.com',
         'china': 'login.chinacloudapi.cn',
-        'gov': 'login-us.microsoftonline.com'
+        'gov': 'login.microsoftonline.us'
     }
 }
 

pip install -e .
parse_log_pytest
requirements.txt
pytest
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/AzureAD/azure-activedirectory-library-for-python.git@b65cdce996c3e275bf82f1563638150c7ac97034#egg=adal
asn1crypto==1.5.1
astroid==1.4.9
attrs==22.2.0
certifi==2021.5.30
cffi==1.15.1
chardet==3.0.4
colorama==0.4.5
cryptography==2.3.1
httpretty==0.8.14
idna==2.7
importlib-metadata==4.8.3
iniconfig==1.1.1
lazy-object-proxy==1.7.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycparser==2.21
PyJWT==1.7.0
pylint==1.5.4
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.1
requests==2.20.0
six==1.17.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.24.3
wrapt==1.16.0
zipp==3.6.0

name: azure-activedirectory-library-for-python
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - asn1crypto==1.5.1
      - astroid==1.4.9
      - attrs==22.2.0
      - cffi==1.15.1
      - chardet==3.0.4
      - colorama==0.4.5
      - cryptography==2.3.1
      - httpretty==0.8.14
      - idna==2.7
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - lazy-object-proxy==1.7.1
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycparser==2.21
      - pyjwt==1.7.0
      - pylint==1.5.4
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.1
      - requests==2.20.0
      - six==1.17.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.24.3
      - wrapt==1.16.0
      - zipp==3.6.0
prefix: /opt/conda/envs/azure-activedirectory-library-for-python

tests/test_authority.py::TestAuthority::test_http_error tests/test_authority.py::TestAuthority::test_success_dynamic_instance_discovery tests/test_authority.py::TestAuthority::test_url_extra_slashes tests/test_authority.py::TestAuthority::test_validation_error tests/test_authority.py::TestAuthority::test_validation_off
tests/test_api_version.py::TestAuthenticationContextApiVersionBehavior::test_api_version_default_value tests/test_api_version.py::TestAuthenticationContextApiVersionBehavior::test_explicitly_turn_off_api_version tests/test_api_version.py::TestOAuth2ClientApiVersionBehavior::test_api_version_is_not_set tests/test_api_version.py::TestOAuth2ClientApiVersionBehavior::test_api_version_is_set tests/test_authority.py::TestAuthority::test_bad_url_has_query tests/test_authority.py::TestAuthority::test_bad_url_not_https tests/test_authority.py::TestAuthority::test_dsts_authority tests/test_authority.py::TestAuthority::test_success_static_instance_discovery tests/test_authority.py::TestAuthority::test_url_extra_path_elements tests/test_authority.py::TestAuthority::test_url_extra_slashes_change_authority_url tests/test_self_signed_jwt.py::TestSelfSignedJwt::test_create_jwt_hash_colons tests/test_self_signed_jwt.py::TestSelfSignedJwt::test_create_jwt_hash_spaces tests/test_self_signed_jwt.py::TestSelfSignedJwt::test_create_jwt_hash_straight_hex tests/test_self_signed_jwt.py::TestSelfSignedJwt::test_create_jwt_invalid_cert tests/test_self_signed_jwt.py::TestSelfSignedJwt::test_create_jwt_invalid_thumbprint_1 tests/test_self_signed_jwt.py::TestSelfSignedJwt::test_create_jwt_invalid_thumbprint_invalid_char tests/test_self_signed_jwt.py::TestSelfSignedJwt::test_create_jwt_invalid_thumbprint_wrong_size tests/test_self_signed_jwt.py::TestSelfSignedJwt::test_jwt_hash_with_public_cert tests/test_user_realm.py::TestUserRealm::test_happy_path_federated tests/test_user_realm.py::TestUserRealm::test_negative_empty_json tests/test_user_realm.py::TestUserRealm::test_negative_fed_err tests/test_user_realm.py::TestUserRealm::test_negative_no_root tests/test_user_realm.py::TestUserRealm::test_negative_wrong_field
adal/constants.py adal/authentication_parameters.py adal/log.py sample/website_sample.py
adal/constants.py adal/authentication_parameters.py adal/log.py sample/website_sample.py