1.0.4 • Published 7 years ago

azure-authenticate-claudia-intercept v1.0.4

Weekly downloads
1
License
BSD-2-Clause
Repository
-
Last release
7 years ago

azure-autheniticate-claudia-intercept

A claudiajs intercept to verify that the token supplied with a request is from an authorised Azure AD user.

usage

const ApiBuilder = require('claudia-api-builder');
const api = new ApiBuilder();

const azureAuthenticateIntercept = require('azure-authenticate-claudia-intercept');
const config = {
  tenantId: '4555f184-f629-4962-a914-2720ccc49c5a'
  audience: 'https://graph.windows.net'
}

api.intercept(azureAuthenticateIntercept(api, 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 audience is used to validate the audience