An Azure Active Directory Token Validation component for node.js that supports AAD v2
npm install azure-ad-jwt-v2Currently the version is not using caching, which means the certificates will be downloaded from Mirosoft with every verification request. If you are using Azure AAD tokens in every request against your API additional caching would make sense.
``javascript
var aad = require('azure-ad-jwt-v2');
var jwtToken = '<
aad.verify(jwtToken, null, function(err, result) {
if (result) {
console.log("JWT is valid");
} else {
console.log("JWT is invalid: " + err);
}
});
`
`javascript``
aad.verify(jwtToken, { audience: 'https://graph.windows.net'}, function(err, result) ...