Skip to content

Commit 3093816

Browse files
committed
Consolidate 6 boxes into 4
1 parent 8535c96 commit 3093816

File tree

1 file changed

+12
-38
lines changed

1 file changed

+12
-38
lines changed

msal/application.py

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,17 @@ def __init__(
280280
281281
.. admonition:: Support using a certificate in X.509 (.pem) format
282282
283-
Deprecated because it uses SHA-1 thumbprint.
283+
Deprecated because it uses SHA-1 thumbprint,
284+
unless you are still using ADFS which supports SHA-1 thumbprint only.
284285
Please use the .pfx option documented later in this page.
285286
286287
Feed in a dict in this form::
287288
288289
{
289290
"private_key": "...-----BEGIN PRIVATE KEY-----... in PEM format",
290-
"thumbprint": "A1B2C3D4E5F6...",
291-
"passphrase": "Passphrase if the private_key is encrypted (Optional. Added in version 1.6.0)",
291+
"thumbprint": "An SHA-1 thumbprint such as A1B2C3D4E5F6...",
292+
"passphrase": "Needed if the private_key is encrypted (Added in version 1.6.0)",
293+
"public_certificate": "...-----BEGIN CERTIFICATE-----...", # Needed if you use Subject Name/Issuer auth. Added in version 0.5.0.
292294
}
293295
294296
MSAL Python requires a "private_key" in PEM format.
@@ -299,28 +301,11 @@ def __init__(
299301
The thumbprint is available in your app's registration in Azure Portal.
300302
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>`_.
301303
302-
.. admonition:: Support Subject Name/Issuer Auth with a cert in .pem
303-
304-
`Subject Name/Issuer Auth
305-
<https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/60>`_
306-
is an approach to allow easier certificate rotation.
307-
308-
Deprecated because it uses SHA-1 thumbprint.
309-
Please use the .pfx option documented later in this page.
310-
311-
*Added in version 0.5.0*::
312-
313-
{
314-
"private_key": "...-----BEGIN PRIVATE KEY-----... in PEM format",
315-
"thumbprint": "A1B2C3D4E5F6...",
316-
"public_certificate": "...-----BEGIN CERTIFICATE-----...",
317-
"passphrase": "Passphrase if the private_key is encrypted (Optional. Added in version 1.6.0)",
318-
}
319-
320304
``public_certificate`` (optional) is public key certificate
321-
which will be sent through 'x5c' JWT header only for
322-
subject name and issuer authentication to support cert auto rolls.
323-
305+
which will be sent through 'x5c' JWT header.
306+
This is useful when you use `Subject Name/Issuer Authentication
307+
<https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/60>`_
308+
which is an approach to allow easier certificate rotation.
324309
Per `specs <https://tools.ietf.org/html/rfc7515#section-4.1.6>`_,
325310
"the certificate containing
326311
the public key corresponding to the key used to digitally sign the
@@ -350,31 +335,20 @@ def __init__(
350335
Feed in a dictionary containing the path to a PFX file::
351336
352337
{
353-
"private_key_pfx_path": "/path/to/your.pfx",
338+
"private_key_pfx_path": "/path/to/your.pfx", # Added in version 1.29.0
339+
"public_certificate": True, # Only needed if you use Subject Name/Issuer auth. Added in version 1.30.0
354340
"passphrase": "Passphrase if the private_key is encrypted (Optional)",
355341
}
356342
357343
The following command will generate a .pfx file from your .key and .pem file::
358344
359345
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.pem
360346
361-
.. admonition:: Support Subject Name/Issuer Auth with a cert in .pfx
362-
363347
`Subject Name/Issuer Auth
364348
<https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/60>`_
365349
is an approach to allow easier certificate rotation.
366-
367-
This usage will automatically use SHA-256 thumbprint of the certificate.
368-
369-
*Added in version 1.30.0*:
370350
If your .pfx file contains both the private key and public cert,
371-
you can opt in for Subject Name/Issuer Auth like this::
372-
373-
{
374-
"private_key_pfx_path": "/path/to/your.pfx",
375-
"public_certificate": True,
376-
"passphrase": "Passphrase if the private_key is encrypted (Optional)",
377-
}
351+
you can opt in for Subject Name/Issuer Auth by setting "public_certificate" to ``True``.
378352
379353
:type client_credential: Union[dict, str, None]
380354

0 commit comments

Comments
 (0)