0.9.1 • Published 9 years ago

hapi-cas v0.9.1

Weekly downloads
15
License
MIT
Repository
github
Last release
9 years ago

hapi-cas

This module provides a Hapi framework authentication plugin which implements CAS authentication. This module requires a session manger plugin to be registered with the Hapi server under which the hapi-cas plugin is registered. The hapi-server-session is known to work.

The API is fully documented in the api.md document.

Install

$ npm install --save --production hapi-cas

Example

A fully working example is provided as test case in the test directory.

const hapi = require('hapi');
const server = new hapi.Server();
server.connection({
  host: 'localhost',
  address: '127.0.0.1',
  port: 8080
});

server.register(require('hapi-cas'), (err) => {
    const options = {
      casServerUrl: 'https://example.com/cas/',
      localAppUrl: 'https://127.0.0.1:8080',
      endPointPath: '/casHandler'
    };
    server.auth.strategy('casauth', 'cas', options);
  }
);

// https://github.com/hapijs/discuss/issues/349
setImmediate(() => {
  server.route({
    method: 'GET',
    path: '/foo',
    handler: function (request, reply) {
      // "username" would have been set from the XML returned by
      // the remote CAS server
      return reply(null, `username = ${request.session.username}`);
    },
    config: {
      auth: {
        strategy: 'casauth'
      }
    }
  });
})

License

MIT License

0.9.1

9 years ago

0.9.0

9 years ago

0.8.1

9 years ago

0.8.0

9 years ago

0.7.0

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.2

9 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago