1.0.18 • Published 1 year ago

node-auth-express v1.0.18

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

NODE-AUTH-EXPRESS

INSTALLATION

You can install node-auth-express via npm:

npm install node-auth-express

USAGE

# Functions

const { nodeAuth, authenticate, permissions } = require('node-auth-express');

# Configurations

EXAMPLE

const express = require('express');
const { nodeAuth, authenticate, permissions } = require('node-auth-express');

const app = express();

app.use(nodeAuth({
    issuerBaseUrl: 'http://localhost:9000/oauth/v1/5xIkCPnv4X',
    baseUrl: 'http://localhost:9000',
    clientId: 'QSzqp99Ow8BIGZrHmN0mtaIInpuzhewZ',
    clientSecret: 'y4oVmZrnwkudsphu5LaNEc6sL11wBT7H',
    audience: 'http://localhost:9000'
}));

app.get('/protected', authenticate, permissions(['product:read', 'product:write']), (req, res) => {
    res.send(req.user);
});

app.listen(3000, () => {
    console.log('Server is running on port 3000');
});
1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

0.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago