fary-sso-proxy
v1.0.1
Published
project description
Downloads
2
Readme
fary-sso-proxy
A fary/koa2 based middleware for sso proxy.
Introduction
It is a dev tool with which you can login a sso server through a simple ajax.
The sso server is based on Apereo CAS
You'd better not use it in production, but use standard SSO process instead.
Install
npm i fary-sso-proxy
Usage
const createApp = require('fary');
const farySSOProxy = require('fary-sso-proxy');
createApp({
middlewares: [
farySSOProxy({
authUrl: 'http://${casServerHost}?service=http://${businessServerHost}/${servicePath}',
method: 'POST',
path: '/api/dev-helper/sso',
parseResult: () => ({}),
})
]
})
Note: this middleware only works directly in Node 7.6+(async/await), or you can use babel to transform the source code.
options
authUrl
: the sso authorization urlmethod?
: defaultPOST
; the request methodpath?
: default/api/dev-helper/sso
; the request pathparseResult?
: default() => ({})
; the parser to restructure the response data to your client