azure-authenticate-express-middleware

1.1.1 • Public • Published

azure-autheniticate-express-middleware

An express middleware to verify that the token supplied with a request is from an authorised Azure AD user.

usage

const express = require('express');
const app = express();
 
const azureAuthenticateMiddleware = require('azure-authenticate-express-middleware');
const config = {
  tenantId: '4555f184-f629-4962-a914-2720ccc49c5a'
  clientId: 'd1348fb9-1ce4-4a1d-bc17-c752863e346b'
}
 
app.use(azureAuthenticateMiddleware(config));

The next piece of middleware excutes if you're token is valid. All other circumstances will return a 401.

  • the tenantId is used to validate the issuer
  • the clientId is used to validate the audience

Package Sidebar

Install

npm i azure-authenticate-express-middleware

Weekly Downloads

1

Version

1.1.1

License

BSD-2-Clause

Last publish

Collaborators

  • distributedlife