1

CAS认证

 2 years ago
source link: https://www.purewhite.io/2017/12/14/cas-authentication/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

CAS 认证

发表于 2017-12-14 更新于 2021-12-02 分类于 后端 阅读次数:769 Disqus:0 Comments 本文字数: 478 阅读时长 ≈ 1 分钟

工作需要学习 CAS,所以边学边写博客来印证自己所学。

CAS——Central Authentication Service,集中式认证服务,顾名思义就是把一个网站群的用户认证挪到同一个地方去进行。

CAS 架构如下图:

cas_architecture

cas_architecture

可以看出来,CAS 主要是用在网站群里面。想想也是,如果有好多个网站都需要用户认证,不可能每个网站自己维护一套用户认证系统,不然维护和开发起来不是太麻烦了,所以需要把用户认证挪到同一个地方去集中地进行,这就是 CAS 的思想。

CAS 服务器和 App 服务器通过协议进行交互,其实也就是相当于我们经常说的 “解耦”,把用户认证的体系给单独剥离出来,使得用户认证体系可以在所有网站中复用。这么说来还有点微服务的意思?其实很多想法都是殊途同归的。

cas_flow_diagram

cas_flow_diagram

这是 CAS 主要的流程,简单来说就是在访问服务器的时候,如果发现没有 session,就去 CAS Server 验证一下,CAS 的 TGT 是为了不让用户重复登录的一个 ticket。

CAS Server 验证完了身份,就给一个 ST,让用户拿给 app,app 用 ST 去 CAS Server 获取到用户的信息,于是创建 session。

请博主喝杯咖啡~
欢迎关注我的其它发布渠道

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK