@fangcha/sso-server
TypeScript icon, indicating that this package has built-in type declarations

0.31.0 • Public • Published

sso-server

Installation

# Use npm
npm install @fangcha/sso-server

# Or use yarn
yarn add @fangcha/sso-server

Options

interface Options {
  database: FCDatabase
  accountServer: AccountServer
  redisConfig: RedisConfig

  // Default: fc_sso_client
  tableName_SsoClient?: string

  // Default: fc_user_auth
  tableName_UserAuth?: string
}

Usage

Step 1. Use SsoServer

import { SsoServer } from '@fangcha/sso-server'
import { AccountServer } from '@fangcha/account'

export const MySsoServer = new SsoServer({
  database: <mysql connection>,
  redisConfig: <redis connection config>,
  accountServer: new AccountServer({
    database: <mysql connection>,
  }),
})

Step 2. Use SsoWebPlugin

import { WebApp } from '@fangcha/backend-kit/lib/router'
import { SsoWebPlugin } from '@fangcha/sso-server/lib/web-sdk'

const app = new WebApp({
  ……
  plugins: [
    SsoWebPlugin({
      ssoServer: MySsoServer,
    }),
    SsoClientsAutoReloadPlugin(MySsoServer),
  ],
})
app.launch()

Readme

Keywords

Package Sidebar

Install

npm i @fangcha/sso-server

Weekly Downloads

2

Version

0.31.0

License

MIT

Unpacked Size

137 kB

Total Files

58

Last publish

Collaborators

  • fangqk1991