Spike npm module: "spike-auth-middleware"
This REPO is a Spike npm module that can be used to recieve an Authorization Bearer Token express.js middleware to allow certain scopes to certain endpoints.
Usage
const path = ;const getSpikeAuthMiddleWare = ; const configuration = audience: 'audience' allowedScopes: "read" pathToPublicKey: path; const allowForReadScopeOnly = ; // express.js code:app
Options For getSpikeAuthMiddleWare
- audience: (String) audience to demand in JWT payload
- pathToPublicKey: full path to public key to authenticate JWT signature with
- allowedScopes: (Array) list of all allowed scopes in this middleware - default: ["read"]
- useBearerToken: (Boolean) set to true if Authorization header should start with 'Bearer' - default: true