Skip to content

Commit d305f61

Browse files
authored
Merge pull request #99 from MicrosoftDocs/smoke-test
CI Update
2 parents 3295d66 + 4fc6646 commit d305f61

5 files changed

+109
-68
lines changed

python/docs-ref-autogen/msal/msal.application.ClientApplication.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,15 @@ constructor:
205205
206206
For example, if client is capable to handle *claims challenge*,
207207
208-
STS can then issue CAE access tokens to resources
208+
STS may issue
209209
210-
knowing when the resource emits *claims challenge*
210+
[Continuous Access Evaluation (CAE)](https://learn.microsoft.com/entra/identity/conditional-access/concept-continuous-access-evaluation)
211211
212-
the client will be capable to handle.
212+
access tokens to resources,
213+
214+
knowing that when the resource emits a *claims challenge*
215+
216+
the client will be able to handle those challenges.
213217
214218
215219
Implementation details:

python/docs-ref-autogen/msal/msal.application.ConfidentialClientApplication.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,15 @@ constructor:
205205
206206
For example, if client is capable to handle *claims challenge*,
207207
208-
STS can then issue CAE access tokens to resources
208+
STS may issue
209209
210-
knowing when the resource emits *claims challenge*
210+
[Continuous Access Evaluation (CAE)](https://learn.microsoft.com/entra/identity/conditional-access/concept-continuous-access-evaluation)
211211
212-
the client will be capable to handle.
212+
access tokens to resources,
213+
214+
knowing that when the resource emits a *claims challenge*
215+
216+
the client will be able to handle those challenges.
213217
214218
215219
Implementation details:

python/docs-ref-autogen/msal/msal.application.PublicClientApplication.yml

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,40 @@ inheritances:
77
- msal.application.ClientApplication
88
summary: "Same as <xref:ClientApplication.__init__>,\nexcept that `client_credential`\
99
\ parameter shall remain `None`.\n\n> [!NOTE]\n> You may set enable_broker_on_windows\
10-
\ to True.\n>\n> \n>\n> What is a broker, and why use it?\n>\n> \n>\n> A broker\
11-
\ is a component installed on your device.\n>\n> Broker implicitly gives your device\
12-
\ an identity. By using a broker,\n>\n> your device becomes a factor that can satisfy\
13-
\ MFA (Multi-factor authentication).\n>\n> This factor would become mandatory\n\
14-
>\n> if a tenant's admin enables a corresponding Conditional Access (CA) policy.\n\
15-
>\n> The broker's presence allows Microsoft identity platform\n>\n> to have higher\
16-
\ confidence that the tokens are being issued to your device,\n>\n> and that is\
17-
\ more secure.\n>\n> \n>\n> An additional benefit of broker is,\n>\n> it runs as\
18-
\ a long-lived process with your device's OS,\n>\n> and maintains its own cache,\n\
19-
>\n> so that your broker-enabled apps (even a CLI)\n>\n> could automatically SSO\
20-
\ from a previously established signed-in session.\n>\n> \n>\n> You shall only enable\
21-
\ broker when your app:\n>\n> \n>\n> is running on supported platforms,\n>\n> and\
22-
\ already registered their corresponding redirect_uri\n>\n> \n>\n> ms-appx-web://Microsoft.AAD.BrokerPlugin/your_client_id\n\
23-
>\n> if your app is expected to run on Windows 10+\n>\n> \n>\n> installed broker\
24-
\ dependency,\n>\n> e.g. pip install msal[broker]>=1.25,<2.\n>\n> \n>\n> tested\
25-
\ with acquire_token_interactive() and acquire_token_silent().\n>\n> \n>\n> The\
26-
\ fallback behaviors of MSAL Python's broker support\n>\n> \n>\n> MSAL will either\
27-
\ error out, or silently fallback to non-broker flows.\n>\n> \n>\n> MSAL will ignore\
28-
\ the enable_broker_... and bypass broker\n>\n> on those auth flows that are known\
29-
\ to be NOT supported by broker.\n>\n> This includes ADFS, B2C, etc..\n>\n> For\
30-
\ other \"could-use-broker\" scenarios, please see below.\n>\n> \n>\n> MSAL errors\
31-
\ out when app developer opted-in to use broker\n>\n> but a direct dependency \"\
32-
mid-tier\" package is not installed.\n>\n> Error message guides app developer to\
33-
\ declare the correct dependency\n>\n> msal[broker].\n>\n> We error out here because\
34-
\ the error is actionable to app developers.\n>\n> \n>\n> MSAL silently \"deactivates\"\
35-
\ the broker and fallback to non-broker,\n>\n> when opted-in, dependency installed\
36-
\ yet failed to initialize.\n>\n> We anticipate this would happen on a device whose\
37-
\ OS is too old\n>\n> or the underlying broker component is somehow unavailable.\n\
38-
>\n> There is not much an app developer or the end user can do here.\n>\n> Eventually,\
39-
\ the conditional access policy shall\n>\n> force the user to switch to a different\
40-
\ device.\n>\n> \n>\n> MSAL errors out when broker is opted in, installed, initialized,\n\
41-
>\n> but subsequent token request(s) failed.\n>"
10+
\ and/or enable_broker_on_mac to True.\n>\n> \n>\n> What is a broker, and why use\
11+
\ it?\n>\n> \n>\n> A broker is a component installed on your device.\n>\n> Broker\
12+
\ implicitly gives your device an identity. By using a broker,\n>\n> your device\
13+
\ becomes a factor that can satisfy MFA (Multi-factor authentication).\n>\n> This\
14+
\ factor would become mandatory\n>\n> if a tenant's admin enables a corresponding\
15+
\ Conditional Access (CA) policy.\n>\n> The broker's presence allows Microsoft identity\
16+
\ platform\n>\n> to have higher confidence that the tokens are being issued to your\
17+
\ device,\n>\n> and that is more secure.\n>\n> \n>\n> An additional benefit of broker\
18+
\ is,\n>\n> it runs as a long-lived process with your device's OS,\n>\n> and maintains\
19+
\ its own cache,\n>\n> so that your broker-enabled apps (even a CLI)\n>\n> could\
20+
\ automatically SSO from a previously established signed-in session.\n>\n> \n>\n\
21+
> You shall only enable broker when your app:\n>\n> \n>\n> is running on supported\
22+
\ platforms,\n>\n> and already registered their corresponding redirect_uri\n>\n\
23+
> \n>\n> ms-appx-web://Microsoft.AAD.BrokerPlugin/your_client_id\n>\n> if your app\
24+
\ is expected to run on Windows 10+\n>\n> \n>\n> msauth.com.msauth.unsignedapp://auth\n\
25+
>\n> if your app is expected to run on Mac\n>\n> \n>\n> installed broker dependency,\n\
26+
>\n> e.g. pip install msal[broker]>=1.31,<2.\n>\n> \n>\n> tested with acquire_token_interactive()\
27+
\ and acquire_token_silent().\n>\n> \n>\n> The fallback behaviors of MSAL Python's\
28+
\ broker support\n>\n> \n>\n> MSAL will either error out, or silently fallback to\
29+
\ non-broker flows.\n>\n> \n>\n> MSAL will ignore the enable_broker_... and bypass\
30+
\ broker\n>\n> on those auth flows that are known to be NOT supported by broker.\n\
31+
>\n> This includes ADFS, B2C, etc..\n>\n> For other \"could-use-broker\" scenarios,\
32+
\ please see below.\n>\n> \n>\n> MSAL errors out when app developer opted-in to\
33+
\ use broker\n>\n> but a direct dependency \"mid-tier\" package is not installed.\n\
34+
>\n> Error message guides app developer to declare the correct dependency\n>\n>\
35+
\ msal[broker].\n>\n> We error out here because the error is actionable to app developers.\n\
36+
>\n> \n>\n> MSAL silently \"deactivates\" the broker and fallback to non-broker,\n\
37+
>\n> when opted-in, dependency installed yet failed to initialize.\n>\n> We anticipate\
38+
\ this would happen on a device whose OS is too old\n>\n> or the underlying broker\
39+
\ component is somehow unavailable.\n>\n> There is not much an app developer or\
40+
\ the end user can do here.\n>\n> Eventually, the conditional access policy shall\n\
41+
>\n> force the user to switch to a different device.\n>\n> \n>\n> MSAL errors out\
42+
\ when broker is opted in, installed, initialized,\n>\n> but subsequent token request(s)\
43+
\ failed.\n>"
4244
constructor:
4345
syntax: PublicClientApplication(client_id, client_credential=None, **kwargs)
4446
parameters:
@@ -53,6 +55,16 @@ constructor:
5355
isRequired: true
5456
types:
5557
- <xref:boolean>
58+
- name: enable_broker_on_mac
59+
description: 'This setting is only effective if your app is running on Mac.
60+
61+
This parameter defaults to None, which means MSAL will not utilize a broker.
62+
63+
64+
New in MSAL Python 1.31.0.'
65+
isRequired: true
66+
types:
67+
- <xref:boolean>
5668
- name: client_id
5769
isRequired: true
5870
- name: client_credential
@@ -208,22 +220,14 @@ methods:
208220
types:
209221
- <xref:int>
210222
- name: parent_window_handle
211-
description: 'Required if your app is running on Windows and opted in to use broker.
212-
213-
214-
If your app is a GUI app,
215-
216-
you are recommended to also provide its window handle,
217-
218-
so that the sign in UI window will properly pop up on top of your window.
219-
220-
221-
If your app is a console app (most Python scripts are console apps),
222-
223-
you can use a placeholder value `msal.PublicClientApplication.CONSOLE_WINDOW_HANDLE`.
224-
225-
226-
New in version 1.20.0.'
223+
description: "OPTIONAL.\n\n* If your app does not opt in to use broker, you do\
224+
\ not need to provide a `parent_window_handle` here. \n\n* If your app opts\
225+
\ in to use broker, `parent_window_handle` is required. \n\n * If your app\
226+
\ is a GUI app running on Windows or Mac system, you are required to also provide\
227+
\ its window handle, so that the sign-in window will pop up on top of your window.\
228+
\ \n\n * If your app is a console app running on Windows or Mac system, you\
229+
\ can use a placeholder `PublicClientApplication.CONSOLE_WINDOW_HANDLE`. \n\n\
230+
Most Python scripts are console apps.\n\nNew in version 1.20.0."
227231
defaultValue: None
228232
types:
229233
- <xref:int>

python/docs-ref-autogen/msal/msal.managed_identity.ManagedIdentityClient.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,34 @@ methods:
8787
\ is a service-side behavior that cannot be changed by this library.\n>\n> [Azure\
8888
\ VM docs](https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#get-a-token-using-http)\n\
8989
>"
90-
signature: acquire_token_for_client(*, resource)
90+
signature: 'acquire_token_for_client(*, resource: str, claims_challenge: str | None
91+
= None)'
92+
parameters:
93+
- name: resource
94+
description: The resource for which the token is acquired.
95+
isRequired: true
96+
- name: claims_challenge
97+
description: 'Optional.
98+
99+
It is a string representation of a JSON object
100+
101+
(which contains lists of claims being requested).
102+
103+
104+
The tenant admin may choose to revoke all Managed Identity tokens,
105+
106+
and then a *claims challenge* will be returned by the target resource,
107+
108+
as a *claims_challenge* directive in the *www-authenticate* header,
109+
110+
even if the app developer did not opt in for the "CP1" client capability.
111+
112+
Upon receiving a *claims_challenge*, MSAL will skip a token cache read,
113+
114+
and will attempt to acquire a new token.'
115+
isRequired: true
91116
keywordOnlyParameters:
92117
- name: resource
93118
isRequired: true
119+
- name: claims_challenge
120+
isRequired: true

python/docs-ref-autogen/msal/msal.token_cache.SerializableTokenCache.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@ inheritances:
77
- msal.token_cache.TokenCache
88
summary: "This serialization can be a starting point to implement your own persistence.\n\
99
\nThis class does NOT actually persist the cache on disk/db/etc..\nDepending on\
10-
\ your need,\nthe following simple recipe for file-based persistence may be sufficient:\n\
11-
\n<!-- literal_block {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\"\
12-
: [], \"backrefs\": [], \"xml:space\": \"preserve\", \"language\": \"default\",\
13-
\ \"force\": false, \"linenos\": false} -->\n\n````default\n\n import os, atexit,\
14-
\ msal\n cache_filename = os.path.join( # Persist cache into this file\n \
15-
\ os.getenv(\"XDG_RUNTIME_DIR\", \"\"), # Automatically wipe out the cache from\
16-
\ Linux when user's ssh session ends. See also https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/690\n\
17-
\ \"my_cache.bin\")\n cache = msal.SerializableTokenCache()\n if os.path.exists(cache_filename):\n\
18-
\ cache.deserialize(open(cache_filename, \"r\").read())\n atexit.register(lambda:\n\
19-
\ open(cache_filename, \"w\").write(cache.serialize())\n # Hint: The\
20-
\ following optional line persists only when state changed\n if cache.has_state_changed\
21-
\ else None\n )\n app = msal.ClientApplication(..., token_cache=cache)\n\
22-
\ ...\n ````"
10+
\ your need,\nthe following simple recipe for file-based, unencrypted persistence\
11+
\ may be sufficient:\n\n<!-- literal_block {\"ids\": [], \"classes\": [], \"names\"\
12+
: [], \"dupnames\": [], \"backrefs\": [], \"xml:space\": \"preserve\", \"language\"\
13+
: \"default\", \"force\": false, \"linenos\": false} -->\n\n````default\n\n import\
14+
\ os, atexit, msal\n cache_filename = os.path.join( # Persist cache into this\
15+
\ file\n os.getenv(\n # Automatically wipe out the cache from Linux\
16+
\ when user's ssh session ends.\n # See also https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/690\n\
17+
\ \"XDG_RUNTIME_DIR\", \"\"),\n \"my_cache.bin\")\n cache = msal.SerializableTokenCache()\n\
18+
\ if os.path.exists(cache_filename):\n cache.deserialize(open(cache_filename,\
19+
\ \"r\").read())\n atexit.register(lambda:\n open(cache_filename, \"w\"\
20+
).write(cache.serialize())\n # Hint: The following optional line persists\
21+
\ only when state changed\n if cache.has_state_changed else None\n )\n\
22+
\ app = msal.ClientApplication(..., token_cache=cache)\n ...\n ````\n\nAlternatively,\
23+
\ you may use a more sophisticated cache persistence library,\n[MSAL Extensions](https://github.com/AzureAD/microsoft-authentication-extensions-for-python),\n\
24+
which provides token cache persistence with encryption, and more."
2325
constructor:
2426
syntax: SerializableTokenCache()
2527
variables:

0 commit comments

Comments
 (0)