New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

hapi-cas

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-cas

An authorization plugin for Hapi that implements JASIG CAS authentication.

latest
Source
npmnpm
Version
0.9.1
Version published
Maintainers
1
Created
Source

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

Keywords

hapi

FAQs

Package last updated on 19 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts