Skip to content

Commit 82f9f0c

Browse files
authored
Merge pull request #290 from AzureAD/release-1.8.0
Release 1.8.0
2 parents 7a7d93b + 32edbb9 commit 82f9f0c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

msal/application.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
# The __init__.py will import this. Not the other way around.
24-
__version__ = "1.7.0"
24+
__version__ = "1.8.0"
2525

2626
logger = logging.getLogger(__name__)
2727

@@ -376,7 +376,6 @@ def initiate_auth_code_flow(
376376
def get_authorization_request_url(
377377
self,
378378
scopes, # type: list[str]
379-
# additional_scope=None, # type: Optional[list]
380379
login_hint=None, # type: Optional[str]
381380
state=None, # Recommended by OAuth2 for CSRF protection
382381
redirect_uri=None,
@@ -425,14 +424,6 @@ def get_authorization_request_url(
425424
426425
:return: The authorization url as a string.
427426
"""
428-
""" # TBD: this would only be meaningful in a new acquire_token_interactive()
429-
:param additional_scope: Additional scope is a concept only in AAD.
430-
It refers to other resources you might want to prompt to consent
431-
for in the same interaction, but for which you won't get back a
432-
token for in this particular operation.
433-
(Under the hood, we simply merge scope and additional_scope before
434-
sending them on the wire.)
435-
"""
436427
authority = kwargs.pop("authority", None) # Historically we support this
437428
if authority:
438429
warnings.warn(
@@ -1007,6 +998,7 @@ def acquire_token_interactive(
1007998
claims_challenge=None,
1008999
timeout=None,
10091000
port=None,
1001+
extra_scopes_to_consent=None,
10101002
**kwargs):
10111003
"""Acquire token interactively i.e. via a local browser.
10121004
@@ -1043,6 +1035,12 @@ def acquire_token_interactive(
10431035
By default we will use a system-allocated port.
10441036
(The rest of the redirect_uri is hard coded as ``http://localhost``.)
10451037
1038+
:param list extra_scopes_to_consent:
1039+
"Extra scopes to consent" is a concept only available in AAD.
1040+
It refers to other resources you might want to prompt to consent for,
1041+
in the same interaction, but for which you won't get back a
1042+
token for in this particular operation.
1043+
10461044
:return:
10471045
- A dict containing no "error" key,
10481046
and typically contains an "access_token" key,
@@ -1054,6 +1052,7 @@ def acquire_token_interactive(
10541052
self._client_capabilities, claims_challenge)
10551053
return self.client.obtain_token_by_browser(
10561054
scope=decorate_scope(scopes, self.client_id) if scopes else None,
1055+
extra_scope_to_consent=extra_scopes_to_consent,
10571056
redirect_uri="http://localhost:{port}".format(
10581057
# Hardcode the host, for now. AAD portal rejects 127.0.0.1 anyway
10591058
port=port or 0),

msal/oauth2cli/authcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
It optionally opens a browser window to guide a human user to manually login.
66
After obtaining an auth code, the web server will automatically shut down.
77
"""
8-
import webbrowser
98
import logging
109
import socket
1110
from string import Template
@@ -35,6 +34,7 @@ def obtain_auth_code(listen_port, auth_uri=None): # Historically only used in t
3534

3635

3736
def _browse(auth_uri):
37+
import webbrowser # Lazy import. Some distro may not have this.
3838
controller = webbrowser.get() # Get a default controller
3939
# Some Linux Distro does not setup default browser properly,
4040
# so we try to explicitly use some popular browser, if we found any.

0 commit comments

Comments
 (0)