Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

azure-ad-verify-token

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-ad-verify-token

Verify JWT issued by Azure Active Directory B2C.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.3K
decreased by-15.55%
Maintainers
1
Weekly downloads
 
Created
Source

NPM Version CI Dependency Status Dev Dependency Status Codecov

Azure AD Verify Token

Verify JWT issued by Azure Active Directory B2C.

Table of Contents

Features

  • 🎉 Verify JWT issued by Azure Active Directory B2C.
  • 🚀 Automatically use the rotated public keys from Azure.
  • 💪 Written in TypeScript.

Installation

npm install azure-ad-verify-token --save

Usage

import { verify, VerifyConfig } from 'azure-ad-verify-token';

const config: VerifyConfig = {
  jwksUri: 'https://contoso.b2clogin.com/contoso.onmicrosoft.com/discovery/v2.0/keys?p=b2c_1_signupsignin1',
  issuer: 'https://contoso.b2clogin.com/3285c484-dce5-4abb-a341-bbe4f2bc8554/v2.0/',
  audience: '99d1275c-e805-483f-b832-600f8130829c'
};

verify(token, config)
  .then(decoded => {
    // verified and decoded token
    console.log(decoded);
  })
  .catch(error => {
    // invalid token
    console.error(decoded);
  });

Configuration options:

PropertyTypeDescription
jwksUristringjwk_uri value obtained from B2C policy metadata endpoint.
issuerstringissuer value obtained from B2C policy metadata endpoint.
audiencestringApplication ID of the application accessing the tenant.

Example metadata endpoints:

References

Development

npm install
npm run build

Keywords

FAQs

Package last updated on 22 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc