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
+91-25Lines changed: 91 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@
12
12
importos
13
13
14
14
from .oauth2cliimportClient, JwtAssertionCreator
15
+
from .oauth2cli.assertionimportAutoRefresher
15
16
from .oauth2cli.oidcimportdecode_part
16
17
from .authorityimportAuthority, WORLD_WIDE
17
18
from .meximportsend_requestasmex_send_request
@@ -22,6 +23,7 @@
22
23
from .regionimport_detect_region
23
24
from .throttled_http_clientimportThrottledHttpClient
24
25
from .cloudshellimport_is_running_in_cloud_shell
26
+
from .managed_identityimportManagedIdentity, ManagedIdentityClient
25
27
26
28
27
29
# The __init__.py will import this. Not the other way around.
@@ -230,32 +232,80 @@ def __init__(
230
232
The thumbprint is available in your app's registration in Azure Portal.
231
233
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>`_.
232
234
233
-
*Added in version 0.5.0*:
234
-
public_certificate (optional) is public key certificate
235
-
which will be sent through 'x5c' JWT header only for
236
-
subject name and issuer authentication to support cert auto rolls.
237
-
238
-
Per `specs <https://tools.ietf.org/html/rfc7515#section-4.1.6>`_,
239
-
"the certificate containing
240
-
the public key corresponding to the key used to digitally sign the
241
-
JWS MUST be the first certificate. This MAY be followed by
242
-
additional certificates, with each subsequent certificate being the
243
-
one used to certify the previous one."
244
-
However, your certificate's issuer may use a different order.
245
-
So, if your attempt ends up with an error AADSTS700027 -
246
-
"The provided signature value did not match the expected signature value",
247
-
you may try use only the leaf cert (in PEM/str format) instead.
248
-
249
-
*Added in version 1.13.0*:
250
-
It can also be a completely pre-signed assertion that you've assembled yourself.
251
-
Simply pass a container containing only the key "client_assertion", like this::
235
+
.. admonition:: Using ``public_certificate`` to support Subject Name/Issuer Auth
252
236
253
-
{
254
-
"client_assertion": "...a JWT with claims aud, exp, iss, jti, nbf, and sub..."
255
-
}
237
+
*Added in version 0.5.0*:
238
+
public_certificate (optional) is public key certificate
239
+
which will be sent through 'x5c' JWT header only for
240
+
subject name and issuer authentication to support cert auto rolls.
241
+
242
+
Per `specs <https://tools.ietf.org/html/rfc7515#section-4.1.6>`_,
243
+
"the certificate containing
244
+
the public key corresponding to the key used to digitally sign the
245
+
JWS MUST be the first certificate. This MAY be followed by
246
+
additional certificates, with each subsequent certificate being the
247
+
one used to certify the previous one."
248
+
However, your certificate's issuer may use a different order.
249
+
So, if your attempt ends up with an error AADSTS700027 -
250
+
"The provided signature value did not match the expected signature value",
251
+
you may try use only the leaf cert (in PEM/str format) instead.
252
+
253
+
.. admonition:: Supporting raw assertion obtained from elsewhere
254
+
255
+
*Added in version 1.13.0*:
256
+
It can also be a completely pre-signed assertion that you've assembled yourself.
257
+
Simply pass a container containing only the key "client_assertion", like this::
258
+
259
+
{
260
+
"client_assertion": "...a JWT with claims aud, exp, iss, jti, nbf, and sub..."
261
+
}
262
+
263
+
.. admonition:: Supporting workload identity federated by Managed Identity
264
+
265
+
*Added in version 1.29.0*:
266
+
A confidential client app can authenticate via a managed identity.
267
+
This is known as "federated identity credential (FIC)" or
0 commit comments