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

Commit f840cac

Browse files
authored
Merge pull request #229 from AzureAD/release-1.2.3
Release 1.2.3
2 parents cf6650d + 4e7a708 commit f840cac

15 files changed

+62
-32
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
---
2+
3+
This library, ADAL for Python, will no longer receive new feature improvements. Instead, use the new library
4+
[MSAL for Python](https://github.com/AzureAD/microsoft-authentication-library-for-python).
5+
6+
* If you are starting a new project, you can get started with the
7+
[MSAL Python docs](https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki)
8+
for details about the scenarios, usage, and relevant concepts.
9+
* If your application is using the previous ADAL Python library, you can follow this
10+
[migration guide](https://docs.microsoft.com/en-us/azure/active-directory/develop/migrate-python-adal-msal)
11+
to update to MSAL Python.
12+
* Existing applications relying on ADAL Python will continue to work.
13+
14+
---
15+
16+
117
# Microsoft Azure Active Directory Authentication Library (ADAL) for Python
218

319
`master` branch | `dev` branch | Reference Docs

adal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
# pylint: disable=wrong-import-position
2929

30-
__version__ = '1.2.2'
30+
__version__ = '1.2.3'
3131

3232
import logging
3333

adal/authentication_context.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,21 @@ def acquire_token_with_client_certificate(self, resource, client_id,
243243
:param str client_id: The OAuth client id of the calling application.
244244
:param str certificate: A PEM encoded certificate private key.
245245
:param str thumbprint: hex encoded thumbprint of the certificate.
246-
:param public_certificate(optional): if not None, it will be sent to the service for subject name
246+
:param str public_certificate(optional): if not None, it will be sent to the service for subject name
247247
and issuer based authentication, which is to support cert auto rolls. The value must match the
248248
certificate private key parameter.
249+
250+
Per `specs <https://tools.ietf.org/html/rfc7515#section-4.1.6>`_,
251+
"the certificate containing
252+
the public key corresponding to the key used to digitally sign the
253+
JWS MUST be the first certificate. This MAY be followed by
254+
additional certificates, with each subsequent certificate being the
255+
one used to certify the previous one."
256+
However, your certificate's issuer may use a different order.
257+
So, if your attempt ends up with an error AADSTS700027 -
258+
"The provided signature value did not match the expected signature value",
259+
you may try use only the leaf cert (in PEM/str format) instead.
260+
249261
:returns: dict with several keys, include "accessToken".
250262
'''
251263
def token_func(self):

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/authority.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ def url(self):
6363
return self._url.geturl()
6464

6565
def _whitelisted(self): # testing if self._url.hostname is a dsts whitelisted domain
66-
for domain in AADConstants.WHITELISTED_DOMAINS:
67-
if self._url.hostname.endswith(domain):
68-
return True
69-
return False
66+
# Add dSTS domains to whitelist based on based on domain
67+
# https://microsoft.sharepoint.com/teams/AzureSecurityCompliance/Security/SitePages/dSTS%20Fundamentals.aspx
68+
return ".dsts." in self._url.hostname
7069

7170
def _validate_authority_url(self):
7271

adal/constants.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,24 +208,14 @@ 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
]
220-
WHITELISTED_DOMAINS = [
221-
# Define dSTS domains whitelist based on its Supported Environments & National Clouds list here
222-
# https://microsoft.sharepoint.com/teams/AzureSecurityCompliance/Security/SitePages/dSTS%20Fundamentals.aspx
223-
'dsts.core.windows.net',
224-
'dsts.core.chinacloudapi.cn',
225-
'dsts.core.cloudapi.de',
226-
'dsts.core.usgovcloudapi.net',
227-
'dsts.core.azure-test.net',
228-
]
229219
INSTANCE_DISCOVERY_ENDPOINT_TEMPLATE = 'https://{authorize_host}/common/discovery/instance?authorization_endpoint={authorize_endpoint}&api-version=1.0' # pylint: disable=invalid-name
230220
AUTHORIZE_ENDPOINT_PATH = '/oauth2/authorize'
231221
TOKEN_ENDPOINT_PATH = '/oauth2/token'

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

docs/source/index.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
.. This file is also inspired by
77
https://pythonhosted.org/an_example_pypi_project/sphinx.html#full-code-example
88
9+
.. note::
10+
This library, ADAL for Python, will no longer receive new feature improvement. Its successor,
11+
`MSAL for Python <https://github.com/AzureAD/microsoft-authentication-library-for-python>`_,
12+
are now generally available.
13+
14+
* If you are starting a new project, you can get started with the
15+
`MSAL Python docs <https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki>`_
16+
for details about the scenarios, usage, and relevant concepts.
17+
* If your application is using the previous ADAL Python library, you can follow this
18+
`migration guide <https://docs.microsoft.com/en-us/azure/active-directory/develop/migrate-python-adal-msal>`_
19+
to update to MSAL Python.
20+
* Existing applications relying on ADAL Python will continue to work.
21+
22+
923
Welcome to ADAL Python's documentation!
1024
=======================================
1125

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 = {

0 commit comments

Comments
 (0)