1.0.1 • Published 7 years ago

fary-sso-proxy v1.0.1

Weekly downloads
7
License
-
Repository
github
Last release
7 years ago

fary-sso-proxy

A fary/koa2 based middleware for sso proxy.

NPM version build status

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 url
  • method?: default POST; the request method
  • path?: default /api/dev-helper/sso; the request path
  • parseResult?: default () => ({}); the parser to restructure the response data to your client
1.0.1

7 years ago

1.0.0

7 years ago