您的位置:首页 > Web前端 > Node.js

nodejs 使用CAS 实现 单点登录(SSO) 【开源库实现,简单】

2017-09-08 16:02 465 查看
大部分企业使用 java 开发业务系统, 针对java cas的认证 demo 比较多 ,还有PHPCAS ,标准的参考这里:

phpCAS 的使用

整理登录流程如下图,图片来自网络



找了不少资料,nodejs 实现的比较少,npm 上库很多,试用了好几个才成功。

推荐这里库 connect-cas

注意参数解析

Many of these options are borrowed from node's url documentation. You may set global options through the .configure() method or override them with any of the exposed middleware.

procotol :The protocol to communicate with the CAS Server. Defaults to 'https'.

host : CAS server hostname

port :CAS server port number. Defaults to 443.

gateway : Send all validation requests through the CAS gateway feature. Defaults to false.

paths

- serviceValidate Path to validate TGT

- proxyValidate Path to validate PGT (not implemented)

- proxy Path to obtain a proxy ticket

- login Path to the CAS login

示例代码
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: