 options (only once in your application)
    const buffer = readFileSync(&quot;c:/temp/key.pem&quot;);

    const config: Configuration = {
        auth: {
            authority: &quot;https://login.microsoftonline.com/{tenant id or common}/&quot;,
            clientId: &quot;{application (client) i}&quot;,
            clientCertificate: {
              thumbprint: &quot;{certificate thumbprint, displayed in AAD}&quot;,
              privateKey: buffer.toString(),
            },
        },
    };

    const