Skip to content

Commit 0de0f20

Browse files
MSAL-Node Docs: Updated references to deprecated thumbprint (#7641)
`thumbprint` is deprecated, and we now expect `thumbprintSha256`.
1 parent 3c37b1b commit 0de0f20

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

lib/msal-node/docs/certificate-credentials.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can build confidential client applications with MSAL Node (web apps, daemon
66

77
- `managed identity`: this is a certificateless scenario, where trust is established via the Azure infrastructure. No secret / certificate management is required. MSAL does not yet implement this feature, but you may use Azure Identity SDK instead. See https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/
88
- `clientSecret`: a secret string generated during the app registration, or updated post registration for an existing application. This is not recommended for production.
9-
- `clientCertificate`: a certificate set during the app registration. The certificate needs to have the private key, because it will be used for signing [an assertion](https://learn.microsoft.com/azure/active-directory/develop/certificate-credentials) that MSAL generates. The `thumbprint` is a _X.509 SHA-1_ thumbprint of the certificate (x5t), and the `privateKey` is the PEM encoded private key.
9+
- `clientCertificate`: a certificate set during the app registration. The certificate needs to have the private key, because it will be used for signing [an assertion](https://learn.microsoft.com/azure/active-directory/develop/certificate-credentials) that MSAL generates. The `thumbprintSha256` is a _X.509 SHA-256_ thumbprint of the certificate, and the `privateKey` is the PEM encoded private key.
1010
- `clientAssertion`: instead of letting MSAL create an [assertion](https://learn.microsoft.com/azure/active-directory/develop/certificate-credentials), the app developer takes control. Useful for adding extra claims to the assertion or for using KeyVault for signing, instead of a local certificate. The certificate used to sign the assertion still needs to be set during app registration.
1111

1212
Note: 1p apps may be required to also send `x5c`. This is the _X.509_ certificate chain used in [subject name/issuer auth scenarios](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/sni.md).
@@ -30,7 +30,7 @@ You need to upload your certificate to **Azure AD**.
3030
1. Navigate to [Azure portal](https://portal.azure.com) and select your Azure AD app registration.
3131
2. Select **Certificates & secrets** blade on the left.
3232
3. Click on **Upload** certificate and select the certificate file to upload (e.g. _example.crt_).
33-
4. Click **Add**. Once the certificate is uploaded, the _thumbprint_, _start date_, and _expiration_ values are displayed.
33+
4. Click **Add**. Once the certificate is uploaded, the _thumbprint (SHA-256)_, _start date_, and _expiration_ values are displayed.
3434

3535
For more information, see: [Register your certificate with Microsoft identity platform](https://docs.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials#register-your-certificate-with-microsoft-identity-platform)
3636

@@ -45,7 +45,7 @@ const config = {
4545
clientId: "YOUR_CLIENT_ID",
4646
authority: "https://login.microsoftonline.com/YOUR_TENANT_ID",
4747
clientCertificate: {
48-
thumbprint: process.env.thumbprint, // a 40-digit hexadecimal string
48+
thumbprintSha256: process.env.thumbprint,
4949
privateKey: process.env.privateKey,
5050
},
5151
},
@@ -55,7 +55,7 @@ const config = {
5555
const cca = new msal.ConfidentialClientApplication(config);
5656
```
5757

58-
Both `thumbprint` and `privateKey` are expected to be strings. `privateKey` is further expected to be in the following form (_PKCS#8_):
58+
Both `thumbprintSha256` and `privateKey` are expected to be strings. `privateKey` is further expected to be in the following form (_PKCS#8_):
5959

6060
```text
6161
-----BEGIN ENCRYPTED PRIVATE KEY-----
@@ -65,7 +65,7 @@ z2HCpDsa7dxOsKIrm7F1AtGBjyB0yVDjlh/FA7jT5sd2ypBh3FVsZGJudQsLRKfE
6565
-----END ENCRYPTED PRIVATE KEY-----
6666
```
6767

68-
> :information_source: Alternatively, your private key may begin with `-----BEGIN PRIVATE KEY-----` (unencrypted _PKCS#8_) or `-----BEGIN RSA PRIVATE KEY-----` (_PKCS#1_). These formats are also permissible. The following can be used to convert any compatible key to the PKCS#8 key type:
68+
> :information*source: Alternatively, your private key may begin with `-----BEGIN PRIVATE KEY-----` (unencrypted \_PKCS#8*) or `-----BEGIN RSA PRIVATE KEY-----` (_PKCS#1_). These formats are also permissible. The following can be used to convert any compatible key to the PKCS#8 key type:
6969
>
7070
> ```bash
7171
> openssl pkcs8 -topk8 -inform PEM -outform PEM -in example.key -out example.key
@@ -204,7 +204,7 @@ const config = {
204204
clientId: "YOUR_CLIENT_ID",
205205
authority: "https://login.microsoftonline.com/YOUR_TENANT_ID",
206206
clientCertificate: {
207-
thumbprint: process.env.thumbprint, // a 40-digit hexadecimal string
207+
thumbprintSha256: process.env.thumbprint,
208208
privateKey: privateKey,
209209
},
210210
},

lib/msal-node/docs/initialize-confidential-client-application.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const clientConfig = {
4545
authority: "your_authority",
4646
clientSecret: process.env.clientSecret, // OR
4747
clientCertificate: {
48-
thumbprint: process.env.thumbprint,
48+
thumbprintSha256: process.env.thumbprint,
4949
privateKey: process.env.privateKey,
5050
}, // OR
5151
clientAssertion: clientAssertionCallback, // or a predetermined clientAssertion string
@@ -62,7 +62,7 @@ const cca = new msal.ConfidentialClientApplication(clientConfig);
6262
- `authority` defaults to `https://login.microsoftonline.com/common/` if the user does not set it during configuration
6363
- A Client credential is mandatory for confidential clients. Client credential can be a:
6464
- `clientSecret` is secret string generated set on the app registration.
65-
- `clientCertificate` is a certificate set on the app registration. The `thumbprint` is a X.509 SHA-1 thumbprint of the certificate, and the `privateKey` is the PEM encoded private key. `x5c` is the optional X.509 certificate chain used in [subject name/issuer auth scenarios](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/sni.md).
65+
- `clientCertificate` is a certificate set on the app registration. The `thumbprintSha256` is a X.509 SHA-256 thumbprint of the certificate, and the `privateKey` is the PEM encoded private key. `x5c` is the optional X.509 certificate chain used in [subject name/issuer auth scenarios](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/sni.md).
6666
- `clientAssertion` is a ClientAssertion object containing an assertion string or a callback function that returns an assertion string that the application uses when requesting a token, as well as the assertion's type (urn:ietf:params:oauth:client-assertion-type:jwt-bearer). The callback is invoked every time MSAL needs to acquire a token from the token issuer. App developers should generally use the callback because assertions expire and new assertions need to be created. App developers are responsible for the assertion lifetime. Use [this mechanism](https://learn.microsoft.com/entra/workload-id/workload-identity-federation-create-trust) to get tokens for a downstream API using a Federated Identity Credential.
6767

6868
## Configure Authority

lib/msal-node/docs/sni.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ First party users should follow the instructions on the [internal AAD wiki](http
88

99
## x5c claim
1010

11-
You will need to supply the string from your `pem` encoded certificate to MSAL configuration object in the `clientCertificate.x5c` field in addition to providing both `clientCertificate.thumbprint` and `clientCertificate.privateKey`:
11+
You will need to supply the string from your `pem` encoded certificate to MSAL configuration object in the `clientCertificate.x5c` field in addition to providing both `clientCertificate.thumbprintSha256` and `clientCertificate.privateKey`:
1212

1313
Example `x5c` string from a `.pem` file:
1414

@@ -49,7 +49,7 @@ const config = {
4949
clientId: "ENTER_CLIENT_ID",
5050
authority: "https://login.microsoftonline.com/ENTER_TENANT_ID",
5151
clientCertificate: {
52-
thumbprint: process.env.thumbprint, // a 40-digit hexadecimal string
52+
thumbprintSha256: process.env.thumbprint,
5353
privateKey: process.env.privateKey,
5454
x5c: process.env.x5c
5555
}

0 commit comments

Comments
 (0)