I've got an on-prem nodejs SPA that I want to secure with MSAL. The Node sample project uses msal-node with this config and it authenticates correctly.
const config = {
auth: {
clientId: "025BlahBlahBlahb3ac",
authority: "https://login.microsoftonline.com/04ccTenantIDdbdaf",
clientSecret: "-6csBlahBlahBlahsqO"
}
However, the tutorial states "Use certificate credentials instead of client secrets in your confidential client applications"
Which, I think, means the config should look like
const config = {
auth: {
clientId: "025BlahBlahBlahb3ac",
authority: "https://login.microsoftonline.com/04ccTenantIDdbdaf",
clientCertificate: {
thumbprint: string;
privateKey: string;
}
};
I've created a certificate in Azure KeyVault (with no secrets yet) and exported the pem, which gives me a private key and certificate. Am I using a jwt plugin or just filling in the thumbprint and privateKey?
The start of the private key in the pem looks like this
-----BEGIN PRIVATE KEY-----
BIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCfGkz5bHZe1g5K
zQXDNHd7RecP+/TgN/4rQdyBeSnNhijyT1cG93cglo9Bg9eAeFMvO8AONNyucdpV
Is this an fs.readFileSync or is there some encoding to do for the key?