1.0.0 • Published 6 years ago
node-sso-connect v1.0.0
NODE-SSO-CONNECT
与 node-sso-server 通讯,实时获取到单点注销和环境变量更新等通知
Installation
$ npm install node-sso-connect --saveimport nsc from 'node-sso-connect';
// 连接sso服务
nsc.connect({
url: 'ws://localhost:3001',
appid: 'appid',
appsecret: 'appsecret',
onConnect: () => {},
onLogout: () => {},
onPublish: () => {},
reStep: 60,
});Attribute
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| url | string | 是 | sso socket 地址 |
| appid | string | 是 | 应用账号 |
| appsecret | string | 是 | 应用私钥 |
| onConnect | function | 否 | 连接成功时触发 |
| onLogout | function | 否 | 单点注销时触发 |
| onPublish | function | 否 | 环境变量发布时触发 |
| onError | function | 否 | 发生异常时触发 |
| reStep | Number | 否 | 断线重连检测间隔(秒),默认 60 |
注意事项
需要
node-sso-server提供服务可参考
node-sso-client使用方式建议
node-sso-connect全局唯一,只实例化一次
1.0.0
6 years ago