1.1.3 • Published 2 years ago
@koumoul/sd-express v1.1.3
Simple Directory - Express
Middleware and router helpers to write expressjs applications that depend on simple-directory for authentication.
npm i @koumoul/sd-express
Initialization:
const app = require('express')()
const session = require('simple-directory-client-express')({directoryUrl: 'http://my-simple-directory', publicUrl: 'http://localhost:8080'})
// These routes are authenticated. In your router req.user will be defined with the content of the session.
app.use('/api', session.auth, apiRouter)
// These routes can all be used as callback redirections from authentication (thanks to session.loginCallback)
// Also they will have req.user but without the cost of crypto verification and session prolongation (thanks to session.decode)
app.use('/ui', session.loginCallback, session.decode, uiRouter)
// The router exposes login, logout and ping routes to manage auth and session.
app.use('/session', session.router)
TODO: Proper documentation of options and functionalities. For now the code is the doc.
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
1.0.0-beta.0
3 years ago
0.21.0
3 years ago
0.20.0
3 years ago
0.19.3
3 years ago
0.19.2
4 years ago
0.19.1
4 years ago
0.19.0
4 years ago
0.18.1
4 years ago
0.18.0
4 years ago
0.17.0
4 years ago
0.16.0
4 years ago
0.16.1
4 years ago
0.15.1
5 years ago
0.15.0
5 years ago
0.14.1
5 years ago
0.14.0
5 years ago
0.13.3
5 years ago
0.13.2
5 years ago
0.13.1
5 years ago
0.13.0
5 years ago
0.12.0
5 years ago
0.11.1
6 years ago
0.11.0
6 years ago
0.10.3
6 years ago
0.10.2
6 years ago
0.10.1
6 years ago
0.10.0
6 years ago