大部分企业使用 java 开发业务系统, 针对java cas的认证 demo 比较多 ,还有PHPCAS ,标准的参考这里:
整理登录流程如下图,图片来自网络
找了不少资料,nodejs 实现的比较少,npm 上库很多,试用了好几个才成功。
注意参数解析
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