shib-middleware

2.0.1 • Public • Published

shib-middleware

Build Status Coverage Status

Express middleware to work with shibboleth headers.

  • Reads shib headers and add them to req object.
  • Authentication middleware to respond with 401 if user not authenticated.
  • Provides route to respond with the shib session data.

Install

$ npm install shib-middleware

Usage

To set up shib data on the request object use the shib middleware.

app.use(shib());

By default shib data is read from live headers. You can pass in an object of your own vars for dev purposes.

app.use(shib({
  name:     'Local Developer',
  email:    'example@ncl.ac.uk',
  username: 'nxx99'
}));

To check if user is authenticated use shib.authenticate.

app.use(shib.authenticate);

To add a route that provides shib session data use sessionResponse.

app.get('/shib_session', shib.sessionResponse);

Readme

Keywords

none

Package Sidebar

Install

npm i shib-middleware

Weekly Downloads

0

Version

2.0.1

License

MIT

Last publish

Collaborators

  • burriko