1.1.0 • Published 4 years ago

authbox.apiauth v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

tested with jest

AuthBox.ApiAuth

Package to provide auth strategy for API projects

Reference as a package through GitHub

To use

Config

Your config requires a section called 'auth' which should look like the following for JWT

{
    auth: {
        type: 'secret',
        secret: 'jwt-signing-secret'
    }
}

And for AzureActiveDirectory

{
    auth: {
        type: 'AAD',
        identityMetadata : 'Url for AAD metadata',
        clientID : 'AAD application id'
    }
}

Usage

const auth = require('authbox.apiauth')
.
.
app.use(auth(app, config));