This class will validate id tokens from Azure B2C by using the public key signing information
- jsonwebtoken
- node-fetch
- node-forge
Validate an ID token
const atv = new AzureTokenValidation()
const idToken = 'THE_AZURE_ID_TOKEN_HERE' // This will be sent in the callback from Azure B2C
atv.validate(idToken).then(result => {
if (result) {
// Token is valid
console.log(result)
} else {
// Token is not valid
}
})