Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions msal-python-conceptual/getting-started/acquiring-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ms.date: 02/07/2024
ms.author: dmwendia
ms.reviewer: shermanouko, rayluo
zone_pivot_groups: msal-python-acquire-token
zone_pivot_group_filename: msal/python/zone-pivot-groups.json
---

# Acquiring tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,13 +696,13 @@ methods:
types:
- <xref:str>
- name: prompt
description: 'By default, no prompt value will be sent, not even "none".
description: 'By default, no prompt value will be sent, not even string `"none"`.

You will have to specify a value explicitly.

Its valid values are defined in Open ID Connect specs
Its valid values are the constants defined in

[https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest)'
<xref:msal.Prompt>.'
defaultValue: None
types:
- <xref:str>
Expand Down Expand Up @@ -774,13 +774,13 @@ methods:
types:
- <xref:str>
- name: prompt
description: 'By default, no prompt value will be sent, not even "none".
description: 'By default, no prompt value will be sent, not even string `"none"`.

You will have to specify a value explicitly.

Its valid values are defined in Open ID Connect specs
Its valid values are the constants defined in

[https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest)'
<xref:msal.Prompt>.'
defaultValue: None
types:
- <xref:str>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,10 @@ methods:
description: "A dict representing the json response from AAD:\n\n* A successful\
\ response would contain \"access_token\" key, \n\n* an error response would\
\ contain \"error\" and usually \"error_description\"."
- uid: msal.application.ConfidentialClientApplication.remove_tokens_for_client
name: remove_tokens_for_client
summary: 'Remove all tokens that were previously acquired via

<xref:msal.application.ConfidentialClientApplication.acquire_token_for_client>
for the current client.'
signature: remove_tokens_for_client()
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,28 @@ summary: "Same as <xref:ClientApplication.__init__>,\nexcept that `client_creden
\ more secure.\n>\n> \n>\n> An additional benefit of broker is,\n>\n> it runs as\
\ a long-lived process with your device's OS,\n>\n> and maintains its own cache,\n\
>\n> so that your broker-enabled apps (even a CLI)\n>\n> could automatically SSO\
\ from a previously established signed-in session.\n>\n> \n>\n> ADFS and B2C do\
\ not support broker.\n>\n> MSAL will automatically fallback to use browser.\n>\n\
> \n>\n> You shall only enable broker when your app:\n>\n> \n>\n> is running on\
\ supported platforms,\n>\n> and already registered their corresponding redirect_uri\n\
>\n> \n>\n> ms-appx-web://Microsoft.AAD.BrokerPlugin/your_client_id\n>\n> if your\
\ app is expected to run on Windows 10+\n>\n> \n>\n> installed broker dependency,\n\
>\n> e.g. pip install msal[broker]>=1.25,<2.\n>\n> \n>\n> tested with acquire_token_interactive()\
\ and acquire_token_silent().\n>"
\ from a previously established signed-in session.\n>\n> \n>\n> You shall only enable\
\ broker when your app:\n>\n> \n>\n> is running on supported platforms,\n>\n> and\
\ already registered their corresponding redirect_uri\n>\n> \n>\n> ms-appx-web://Microsoft.AAD.BrokerPlugin/your_client_id\n\
>\n> if your app is expected to run on Windows 10+\n>\n> \n>\n> installed broker\
\ dependency,\n>\n> e.g. pip install msal[broker]>=1.25,<2.\n>\n> \n>\n> tested\
\ with acquire_token_interactive() and acquire_token_silent().\n>\n> \n>\n> The\
\ fallback behaviors of MSAL Python's broker support\n>\n> \n>\n> MSAL will either\
\ error out, or silently fallback to non-broker flows.\n>\n> \n>\n> MSAL will ignore\
\ the enable_broker_... and bypass broker\n>\n> on those auth flows that are known\
\ to be NOT supported by broker.\n>\n> This includes ADFS, B2C, etc..\n>\n> For\
\ other \"could-use-broker\" scenarios, please see below.\n>\n> \n>\n> MSAL errors\
\ out when app developer opted-in to use broker\n>\n> but a direct dependency \"\
mid-tier\" package is not installed.\n>\n> Error message guides app developer to\
\ declare the correct dependency\n>\n> msal[broker].\n>\n> We error out here because\
\ the error is actionable to app developers.\n>\n> \n>\n> MSAL silently \"deactivates\"\
\ the broker and fallback to non-broker,\n>\n> when opted-in, dependency installed\
\ yet failed to initialize.\n>\n> We anticipate this would happen on a device whose\
\ OS is too old\n>\n> or the underlying broker component is somehow unavailable.\n\
>\n> There is not much an app developer or the end user can do here.\n>\n> Eventually,\
\ the conditional access policy shall\n>\n> force the user to switch to a different\
\ device.\n>\n> \n>\n> MSAL errors out when broker is opted in, installed, initialized,\n\
>\n> but subsequent token request(s) failed.\n>"
constructor:
syntax: PublicClientApplication(client_id, client_credential=None, **kwargs)
parameters:
Expand Down Expand Up @@ -100,13 +114,13 @@ methods:
types:
- <xref:list>
- name: prompt
description: 'By default, no prompt value will be sent, not even "none".
description: 'By default, no prompt value will be sent, not even string `"none"`.

You will have to specify a value explicitly.

Its valid values are defined in Open ID Connect specs
Its valid values are the constants defined in

[https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest)'
<xref:msal.Prompt>.'
defaultValue: None
types:
- <xref:str>
Expand Down Expand Up @@ -192,15 +206,21 @@ methods:
types:
- <xref:int>
- name: parent_window_handle
description: 'OPTIONAL. If your app is a GUI app running on modern Windows system,
description: 'Required if your app is running on Windows and opted in to use broker.

and your app opts in to use broker,

If your app is a GUI app,

you are recommended to also provide its window handle,

so that the sign in UI window will properly pop up on top of your window.


If your app is a console app (most Python scripts are console apps),

you can use a placeholder value `msal.PublicClientApplication.CONSOLE_WINDOW_HANDLE`.


New in version 1.20.0.'
defaultValue: None
types:
Expand Down
44 changes: 40 additions & 4 deletions xrefmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2227,6 +2227,18 @@ references:
href: https://docs.python.org/3/library/enum.html#enum.Enum._ignore_
name: _ignore_
uid: enum.Enum._ignore_
- fullName: enum.Enum._name_
href: https://docs.python.org/3/library/enum.html#enum.Enum._name_
name: _name_
uid: enum.Enum._name_
- fullName: enum.Enum._order_
href: https://docs.python.org/3/library/enum.html#enum.Enum._order_
name: _order_
uid: enum.Enum._order_
- fullName: enum.Enum._value_
href: https://docs.python.org/3/library/enum.html#enum.Enum._value_
name: _value_
uid: enum.Enum._value_
- fullName: enum.Enum.name
href: https://docs.python.org/3/library/enum.html#enum.Enum.name
name: name
Expand All @@ -2247,6 +2259,10 @@ references:
href: https://docs.python.org/3/library/enum.html#enum.EnumCheck.UNIQUE
name: UNIQUE
uid: enum.EnumCheck.UNIQUE
- fullName: enum.EnumType.__members__
href: https://docs.python.org/3/library/enum.html#enum.EnumType.__members__
name: __members__
uid: enum.EnumType.__members__
- fullName: enum.FlagBoundary.CONFORM
href: https://docs.python.org/3/library/enum.html#enum.FlagBoundary.CONFORM
name: CONFORM
Expand Down Expand Up @@ -8071,6 +8087,10 @@ references:
href: https://docs.python.org/3/reference/datamodel.html#codeobject.co_positions
name: co_positions
uid: codeobject.co_positions
- fullName: codeobject.replace
href: https://docs.python.org/3/reference/datamodel.html#codeobject.replace
name: replace
uid: codeobject.replace
- fullName: collections.ChainMap.new_child
href: https://docs.python.org/3/library/collections.html#collections.ChainMap.new_child
name: new_child
Expand Down Expand Up @@ -10331,10 +10351,18 @@ references:
href: https://docs.python.org/3/library/enum.html#enum.Enum.__format__
name: __format__
uid: enum.Enum.__format__
- fullName: enum.Enum.__init__
href: https://docs.python.org/3/library/enum.html#enum.Enum.__init__
name: __init__
uid: enum.Enum.__init__
- fullName: enum.Enum.__init_subclass__
href: https://docs.python.org/3/library/enum.html#enum.Enum.__init_subclass__
name: __init_subclass__
uid: enum.Enum.__init_subclass__
- fullName: enum.Enum.__new__
href: https://docs.python.org/3/library/enum.html#enum.Enum.__new__
name: __new__
uid: enum.Enum.__new__
- fullName: enum.Enum.__repr__
href: https://docs.python.org/3/library/enum.html#enum.Enum.__repr__
name: __repr__
Expand Down Expand Up @@ -16851,10 +16879,6 @@ references:
href: https://docs.python.org/3/library/turtle.html#turtle.Shape.addcomponent
name: addcomponent
uid: turtle.Shape.addcomponent
- fullName: types.CodeType.replace
href: https://docs.python.org/3/library/types.html#types.CodeType.replace
name: replace
uid: types.CodeType.replace
- fullName: types.MappingProxyType.copy
href: https://docs.python.org/3/library/types.html#types.MappingProxyType.copy
name: copy
Expand Down Expand Up @@ -21503,6 +21527,14 @@ references:
href: https://docs.python.org/3/library/msilib.html#msilib.text
name: text
uid: msilib.text
- fullName: msvcrt.CRT_ASSEMBLY_VERSION
href: https://docs.python.org/3/library/msvcrt.html#msvcrt.CRT_ASSEMBLY_VERSION
name: CRT_ASSEMBLY_VERSION
uid: msvcrt.CRT_ASSEMBLY_VERSION
- fullName: msvcrt.LIBRARIES_ASSEMBLY_NAME_PREFIX
href: https://docs.python.org/3/library/msvcrt.html#msvcrt.LIBRARIES_ASSEMBLY_NAME_PREFIX
name: LIBRARIES_ASSEMBLY_NAME_PREFIX
uid: msvcrt.LIBRARIES_ASSEMBLY_NAME_PREFIX
- fullName: msvcrt.LK_LOCK
href: https://docs.python.org/3/library/msvcrt.html#msvcrt.LK_LOCK
name: LK_LOCK
Expand All @@ -21523,6 +21555,10 @@ references:
href: https://docs.python.org/3/library/msvcrt.html#msvcrt.LK_UNLCK
name: LK_UNLCK
uid: msvcrt.LK_UNLCK
- fullName: msvcrt.VC_ASSEMBLY_PUBLICKEYTOKEN
href: https://docs.python.org/3/library/msvcrt.html#msvcrt.VC_ASSEMBLY_PUBLICKEYTOKEN
name: VC_ASSEMBLY_PUBLICKEYTOKEN
uid: msvcrt.VC_ASSEMBLY_PUBLICKEYTOKEN
- fullName: object.__match_args__
href: https://docs.python.org/3/reference/datamodel.html#object.__match_args__
name: __match_args__
Expand Down