koa2-cas-authentication
1.0.2 • Public • Published Installation
npm install koa-authentication
Usage
This library is based on cas-authentication, and the interface is the same. You can refer to that documwnt.
usage
const CasAuthentication = require('koa2-cas-authentication');
const casConfig = require('../config/cas');
const cas = new CasAuthentication(Object.assign(casConfig, {
session_info: 'user',
session_name: 'username'
}));
...
const isLogin = await cas.bounce(ctx);
if (isLogin) {
await ctx.render('index');
}
Package Sidebar
Install
npm i koa2-cas-authentication
Weekly Downloads