You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: msal/application.py
+92-23Lines changed: 92 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
importos
9
9
10
10
from .oauth2cliimportClient, JwtAssertionCreator
11
+
from .oauth2cli.assertionimportAutoRefresher
11
12
from .oauth2cli.oidcimportdecode_part
12
13
from .authorityimportAuthority, WORLD_WIDE
13
14
from .meximportsend_requestasmex_send_request
@@ -18,6 +19,7 @@
18
19
from .regionimport_detect_region
19
20
from .throttled_http_clientimportThrottledHttpClient
20
21
from .cloudshellimport_is_running_in_cloud_shell
22
+
from .managed_identityimportManagedIdentity, ManagedIdentityClient
21
23
22
24
23
25
# The __init__.py will import this. Not the other way around.
@@ -249,29 +251,76 @@ def __init__(
249
251
The thumbprint is available in your app's registration in Azure Portal.
250
252
Alternatively, you can `calculate the thumbprint <https://github.com/Azure/azure-sdk-for-python/blob/07d10639d7e47f4852eaeb74aef5d569db499d6e/sdk/identity/azure-identity/azure/identity/_credentials/certificate.py#L94-L97>`_.
251
253
252
-
*Added in version 0.5.0*:
253
-
public_certificate (optional) is public key certificate
254
-
which will be sent through 'x5c' JWT header only for
255
-
subject name and issuer authentication to support cert auto rolls.
256
-
257
-
Per `specs <https://tools.ietf.org/html/rfc7515#section-4.1.6>`_,
258
-
"the certificate containing
259
-
the public key corresponding to the key used to digitally sign the
260
-
JWS MUST be the first certificate. This MAY be followed by
261
-
additional certificates, with each subsequent certificate being the
262
-
one used to certify the previous one."
263
-
However, your certificate's issuer may use a different order.
264
-
So, if your attempt ends up with an error AADSTS700027 -
265
-
"The provided signature value did not match the expected signature value",
266
-
you may try use only the leaf cert (in PEM/str format) instead.
267
-
268
-
*Added in version 1.13.0*:
269
-
It can also be a completely pre-signed assertion that you've assembled yourself.
270
-
Simply pass a container containing only the key "client_assertion", like this::
254
+
.. admonition:: Using ``public_certificate`` to support Subject Name/Issuer Auth
271
255
272
-
{
273
-
"client_assertion": "...a JWT with claims aud, exp, iss, jti, nbf, and sub..."
274
-
}
256
+
*Added in version 0.5.0*:
257
+
public_certificate (optional) is public key certificate
258
+
which will be sent through 'x5c' JWT header only for
259
+
subject name and issuer authentication to support cert auto rolls.
260
+
261
+
Per `specs <https://tools.ietf.org/html/rfc7515#section-4.1.6>`_,
262
+
"the certificate containing
263
+
the public key corresponding to the key used to digitally sign the
264
+
JWS MUST be the first certificate. This MAY be followed by
265
+
additional certificates, with each subsequent certificate being the
266
+
one used to certify the previous one."
267
+
However, your certificate's issuer may use a different order.
268
+
So, if your attempt ends up with an error AADSTS700027 -
269
+
"The provided signature value did not match the expected signature value",
270
+
you may try use only the leaf cert (in PEM/str format) instead.
271
+
272
+
.. admonition:: Supporting raw assertion obtained from elsewhere
273
+
274
+
*Added in version 1.13.0*:
275
+
It can also be a completely pre-signed assertion that you've assembled yourself.
276
+
Simply pass a container containing only the key "client_assertion", like this::
277
+
278
+
{
279
+
"client_assertion": "...a JWT with claims aud, exp, iss, jti, nbf, and sub..."
280
+
}
281
+
282
+
.. admonition:: Supporting workload identity federated by Managed Identity
283
+
284
+
*Added in version 1.29.0*:
285
+
A confidential client app can authenticate via a managed identity.
286
+
This is known as "federated identity credential (FIC)" or
0 commit comments