fly-in-sso
v1.0.5
Published
koa middleware for iflytek-in sso
Downloads
2
Maintainers
Readme
fly-in-sso
koa middlwware for iflytek-in sso
Installation
# npm
$ npm install fly-in-sso
# yarn
$ yarn add fly-in-sso
Example
// 配置项
const option = {
loginPath: '/login', // 静默登入
logoutPath: '/logout',
checkLoginStateUrl: (signId, loginUserAccount) => `https://ssoqxb.iflytek.com:8443/sso/loginState/check?userSignId=${signId}&userAccount=${loginUserAccount}`,
loginUrl: path => `https://ssoqxb.iflytek.com:8443/sso/login?service=${path}`,
logoutUrl: path => `https://ssoqxb.iflytek.com:8443/sso/logout?service=${path}`,
validateTicketUrl: (path, ticket) => `https://ssoqxb.iflytek.com:8443/sso/p3/serviceValidate?service=${path}&ticket=${ticket}`,
forceSyncLoginState: false, // 强制与sso中心保持时时同步
ignore: [
'/favicon.ico',
'/public/:key*',
'/uploads/:key*',
'/',
'/index.html',
'/list',
'/detail.html',
'/detail'
],
}
const sso = require('fly-in-sso');
const Koa = require('koa');
const app = new Koa();
app.use(sso(option));
app.listen(3000);