JSPM

azure-jwt-verify

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 966
  • Score
    100M100P100Q111036F
  • License MIT

Verify JWT Token issued by Azure Active Directory B2C

Package Exports

  • azure-jwt-verify

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (azure-jwt-verify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

azure-jwt-verify

npm version license

This Plugin Requires

  • NodeJS Runtime

Features

  • Verify JWT Token issued by Azure Active Directory B2C
  • Automatically use the rotated public key from Azure Public Keys URL

Install Plugin

npm install --save azure-jwt-verify

Using Azure JWT Verify in your code

You need to define the following constants based on your Azure Active Directory B2C application configurations

###Initialize module

var azureJWT = requre('azure-jwt-verify');

###Configuration and the JWT to verify

var jwtToken = "YOUR_JWT_TOKEN_TO_VERIFY"; // You can find this url in Azure Active Directory B2C Section
const config = {
    JWK_URI: "",
    ISS: "",
    AUD: ""
};
  • JWK_URI and the ISS(Issuer) can be obtained from the metadata endpoint of the policies created in the B2C tenant.
  • AUD(Audience) is the Client ID of the application accessing the tenant.

###Verify Function

azureJWT.verify(jwtToken, config).then(function(decoded){
// success callback

}, function(error){
// error callback

})

License

MIT