2.0.1 • Published 8 years ago

shib-middleware v2.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

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);
2.0.1

8 years ago

2.0.0

8 years ago

1.0.2

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago