21. CAS Authentication

CAS-认证流程详解 基础知识 名词解释 AS Authentication Service:认证服务,发放TGT KDC Key Distribution Center:密钥发放中心 TGS Ticket-Granting Service:票据授权服务,索取TGT,发放ST TGC ticket-granting cookie:授权的票据证明,由CAS Server通过SSL方式发送给终端用户。该值存在Cookie中,根据TGC可以找到TGT。 TGT Ticket Granting tieckt:俗称大令牌,或者票根,由KD 阅读详情
21. CAS Authentication
Prev Part V. Additional Topics Next

21. CAS Authentication

21.1 Overview

JA-SIG produces an enterprise-wide single sign on system known as CAS. Unlike other initiatives, JA-SIG's Central Authentication Service is open source, widely used, simple to understand, platform independent, and supports proxy capabilities. Spring Security fully supports CAS, and provides an easy migration path from single-application deployments of Spring Security through to multiple-application deployments secured by an enterprise-wide CAS server.

You can learn more about CAS at http://www.ja-sig.org/cas. You will also need to visit this site to download the CAS Server files.

21.2 How CAS Works

Whilst the CAS web site contains documents that detail the architecture of CAS, we present the general overview again here within the context of Spring Security. Spring Security 3.0 supports CAS 3. At the time of writing, the CAS server was at version 3.3.

Somewhere in your enterprise you will need to setup a CAS server. The CAS server is simply a standard WAR file, so there isn't anything difficult about setting up your server. Inside the WAR file you will customise the login and other single sign on pages displayed to users.

When deploying a CAS 3.3 server, you will also need to specify an AuthenticationHandler in the deployerConfigContext.xml included with CAS. The AuthenticationHandler has a simple method that returns a boolean as to whether a given set of Credentials is valid. Your AuthenticationHandler implementation will need to link into some type of backend authentication repository, such as an LDAP server or database. CAS itself includes numerous AuthenticationHandlers out of the box to assist with this. When you download and deploy the server war file, it is set up to successfully authenticate users who enter a password matching their username, which is useful for testing.

Apart from the CAS server itself, the other key players are of course the secure web applications deployed throughout your enterprise. These web applications are known as "services". There are two types of services: standard services and proxy services. A proxy service is able to request resources from other services on behalf of the user. This will be explained more fully later.

21.3 Configuration of CAS Client

The web application side of CAS is made easy due to Spring Security. It is assumed you already know the basics of using Spring Security, so these are not covered again below. We'll assume a namespace based configuration is being used and add in the CAS beans as required.

You will need to add a ServiceProperties bean to your application context. This represents your CAS service:

 

  <bean id="serviceProperties"
        class="org.springframework.security.cas.ServiceProperties">
    <property name="service"
        value="https://localhost:8443/cas-sample/j_spring_cas_security_check"/>
    <property name="sendRenew" value="false"/>
  </bean>
    

 

The service must equal a URL that will be monitored by the CasAuthenticationFilter. The sendRenew defaults to false, but should be set to true if your application is particularly sensitive. What this parameter does is tell the CAS login service that a single sign on login is unacceptable. Instead, the user will need to re-enter their username and password in order to gain access to the service.

The following beans should be configured to commence the CAS authentication process (assuming you're using a namespace configuration):

 

<security:http entry-point-ref="casEntryPoint">
   ...
   <custom-filter position="FORM_LOGIN_FILTER" ref="myFilter" />
</security:http>

<bean id="casFilter"
      class="org.springframework.security.cas.web.CasAuthenticationFilter">
  <property name="authenticationManager" ref="authenticationManager"/>
</bean>

<bean id="casEntryPoint"
    class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
  <property name="loginUrl" value="https://localhost:9443/cas/login"/>
  <property name="serviceProperties" ref="serviceProperties"/>
</bean>

    

 

The CasAuthenticationEntryPoint should be selected to drive authentication using entry-point-ref.

The CasAuthenticationFilter has very similar properties to the UsernamePasswordAuthenticationFilter (used for form-based logins).

For CAS to operate, the ExceptionTranslationFilter must have its authenticationEntryPoint property set to the CasAuthenticationEntryPoint bean.

The CasAuthenticationEntryPoint must refer to the ServiceProperties bean (discussed above), which provides the URL to the enterprise's CAS login server. This is where the user's browser will be redirected.

Next you need to add a CasAuthenticationProvider and its collaborators:

  <security:authentication-manager alias="authenticationManager">
    <security:authentication-provider ref="casAuthenticationProvider" />
  </security:authentication-manager>

  <bean id="casAuthenticationProvider"
      class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
    <property name="userDetailsService" ref="userService"/>
    <property name="serviceProperties" ref="serviceProperties" />
    <property name="ticketValidator">
      <bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
        <constructor-arg index="0" value="https://localhost:9443/cas" />
        </bean>
    </property>
    <property name="key" value="an_id_for_this_auth_provider_only"/>
  </bean>

  <security:user-service id="userService">
    <security:user name="joe" password="joe" authorities="ROLE_USER" />
    ...
  </security:user-service>
      

The CasAuthenticationProvider uses a UserDetailsService instance to load the authorities for a user, once they have been authentiated by CAS. We've shown a simple in-memory setup here.

The beans are all reasonable self-explanatory if you refer back to 

安全系列之CAS系统 前言 本期介绍一下CAS(Central Authentiction Service )中心认证服务,以Apereo CAS工程为核心讲解CAS是怎么解决商业级系统SSO(single sign-on)认证问题的。 目录 前言 一,SSO与SLO 二,CAS系统架构 三,CAS client 四 , CAS server 五,CAS protocol 一,SSO与SLO 在介绍CAS工作之前,要先从SSO的故事讲起。SSO(single sign-on)单点登陆和SLO(single . 阅读详情

相关推荐

CAS单点登录系统实践指南与配置模板

单点登录(Single Sign-On,简称SSO)是一种用户身份验证过程,其中用户仅需一次登录即可访问多个相关系统。与传统的每个系统都需要单独登录的方式相比,SSO大大提升了用户体验,并增强了安全性。CAS(Central Authentication Service)是一个企业级的单点登录解决方案,起源于耶鲁大学,并迅速成为开源社区推崇的认证框架。自其首次发布以来,CAS已经历了多个版本的迭代,不断添加新的功能并改进现有功能,以满足日益增长的安全认证需求。

weixin_34520664的博客 966

cas单点登录-自定义登录验证(四)

我们在使用SSO单点登录的时候不只是验证一下用户名和密码是否一致,有时候还需要验证一些别的校验,那么这一张讲一下如何自定义验证器。自定义验证很重要,因为我们后续的很多功能,都是基于自定义验证。 CAS服务器的org.apereo.cas.authentication.AuthenticationManager负责基于提供的凭证信息进行用户认证。与Spring Security很相似,实际的认证委托给了一个或多个实现了org.apereo.cas.authentication.AuthenticationHa

weixin_42073629的博客 2768

cas-authentication:设计为用作Express服务器中间件的CAS身份验证库

Express CAS认证 这是旨在与Express服务器一起使用的CAS身份验证库。 它提供了两个中间件功能来控制对路由的访问: bounce :将未经身份验证的客户端重定向到CAS登录页面,然后返回到请求的页面。 block :完全拒绝访问未经身份验证的客户端,并返回401响应。 它还提供了两个路由端点功能: bounce_redirect :行为与bounce但是一旦客户端通过身份验证,它们将被重定向到提供的returnTo查询参数。 logout :使用Express服务器取消对客户端的身份验证,然后将其重定向到CAS注销页面。 安装 npm install cas-authentication 设置 var CASAuthentication = require ( 'cas-authentication' ) ; var cas = new CASAuthentic

Vue 接入 CAS统一认证登录

CAS(Central Authentication Service)是一种单点登录协议,可以实现多个应用程序之间的用户身份认证和授权。在 Vue 中接入 CAS 统一认证,可以实现用户在一个应用程序中登录后,在其他应用程序中无需再次登录,提高用户体验。以下是在 Vue 中接入 CAS 统一认证的一般步骤:安装库在main.js中引入库其中,是 CAS 服务器的 URL 前缀,是 Vue 应用程序的 URL。在需要进行认证的组件中使用方法进行登录login() {在需要进行认证的路由中添加属性在。

dongwuming的专栏 4540

RTKLIB PPP与RTK_POST精密定位实战:从实时到事后处理的完整流程解析

本文详细解析了如何使用RTKLIB进行精密单点定位(PPP)的完整流程,涵盖从实时处理到事后处理(RTK_POST)的关键步骤。文章深入探讨了数据准备、软件配置、核心参数设置(如电离层、对流层、潮汐改正)以及常见问题排查,旨在帮助用户掌握高精度GNSS定位技术,实现从入门到精通的实战应用。

weixin_29047919的博客 282

从理论到实践:全面解析Cmk(设备能力指数)的应用与优化

本文全面解析了设备能力指数Cmk的核心概念、计算逻辑与关键应用场景。Cmk作为衡量设备本身固有加工能力的黄金标准,在设备验收、大修后验证及过程能力根因分析中至关重要。文章通过实战案例,详细阐述了执行Cmk测试的“五大固定”黄金法则、数据计算分析方法,并提供了Cmk不达标时的系统性排查与优化策略,帮助制造企业实现预防性质量管理。

jump7的博客 529

Vue中如何进行分布式鉴权与认证

分布式鉴权与认证是指将鉴权和认证的过程分布在多个服务中进行。在分布式系统中,用户的请求通常需要经过多个服务的处理,因此需要在每个服务中进行鉴权和认证,以确保用户的合法性和权限。同时,由于用户的信息可能分布在多个服务中,因此需要进行跨服务的认证和授权,以确保用户的数据安全性。在Vue应用中,实现分布式鉴权与认证是非常重要的安全性措施。本文介绍了使用JWT、OAuth2和CAS实现分布式鉴权与认证的步骤,希望能够帮助读者更好地保护用户的安全性和数据的保密性。

u013749113的博客 2006

基于FPGA进位链的TDC高精度延时链设计与实现

本文详细介绍了基于FPGA进位链的高精度TDC延时链设计与实现方法。通过利用FPGA的CARRY4硬件资源,构建了理论分辨率达13.25ps/级的延时链,并提供了Verilog代码实现、物理布局约束技巧以及温度补偿策略。文章还涵盖了标定方法、数据转换处理和系统验证方案,为激光测距、高能物理等需要精确时间测量的应用提供了实用解决方案。

weixin_28731223的博客 488

cas(中央认证服务)

CAS是Central Authentication Service的缩写,中央认证服务,一种独立开放指令协议。CAS 是Yale大学发起的一个开源项目,旨在为 Web 应用系统提供一种可靠的单点登录方法,CAS 在 2004 年 12 月正式成为 JA-SIG 的一个项目。 中文名 中央认证服务器 外文名 Central Authentication Service (CAS) 成...

随风而逝的博客 1362

PaddleOCR GPU部署:从环境配置到避坑实战指南

本文详细介绍了PaddleOCR GPU部署的全过程,从环境配置到避坑实战指南。通过分析常见的部署失败原因,提供硬件兼容性自查、软件环境精配方案以及路径配置的解决方案,帮助用户高效完成GPU加速的OCR任务部署,避免90%的常见错误。

weixin_30839881的博客 419

FreeRTOS全攻略:从入门到精通

本文聚焦 FreeRTOS,从基础概念出发,阐述其开源、轻量级等优势。着重介绍 FreeRTOS 入门知识,涵盖内存管理、任务操作、同步互斥机制等核心内容。其中,空闲任务与钩子函数保障系统基础运行与功能扩展;队列、信号量、互斥锁和事件组等机制,分别从数据传递、资源访问控制、优先级问题解决及多任务同步等方面,为开发者提供高效的任务间协作与资源管理方案,助力开发者掌握 FreeRTOS 核心技术,为嵌入式项目开发筑牢基础。

邓邓子的博客 6360

单点登录开源框架cas7.0.x学习springboot+gradle+jdk21

如何基于springboot构建最新版cas源码

cccfire的博客 1278

C#实现网络寻路(附完整源码)

C#实现网络寻路(附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 426

CAS(Central Authentication Service)详解

摘要:CAS(Central Authentication Service)是由耶鲁大学开发的开源单点登录(SSO)协议,通过中心化认证机制实现用户一次登录即可访问多个Web应用。其核心流程包括:用户访问受保护应用时重定向至CAS Server认证,验证成功后返回临时票据(Ticket)并建立会话。CAS支持多种认证方式(LDAP/JDBC等),具有跨平台、协议简单等优势,但也存在安全性较弱、移动端支持不足等局限。

onlymscn的博客 1638

226届数字IC秋招笔试面试全攻略

本文系统介绍了数字IC设计岗位面试的核心技巧,聚焦三大关键环节:自我介绍、项目介绍和技术问题回答。在自我介绍部分,强调1-2分钟结构化表达,突出与岗位匹配的技能和量化成果;项目介绍环节提出"背景-职责-技术-难点-成果"五步框架,建议结合架构图和性能数据展示技术深度;技术问题回答策略包括理解问题、结构化思考、举例说明和诚实应对未知。文章还提供了项目包装方法,指导如何通过量化数据、架构创新展示和技术难点解决方案来突出项目亮点,并附有简历项目描述示例和技术问题回答模板,帮助面试者全方位展示专

2301_79143213的博客 1063

C++(Qt)软件调试---gdb调试入门用法(12)

学习GDB可以帮助程序员更好地调试程序,找到程序中的错误和问题,提高程序的质量和稳定性。 在开发大型软件时,程序中可能存在许多错误和问题,这些问题可能会导致程序崩溃或者出现不可预期的行为。 使用GDB可以帮助程序员更快地找到这些问题,并且提供一些调试工具来帮助程序员更好地理解程序的行为。

mahuifa的博客 5565

Central Authentication Service(CAS)

Central Authentication Service(CAS)之一(note)   CAS作为一个授权服务应用,分为服务器和客户端两个部分,与其相关联的东西也挺多的,我接触到的主要有JDK、Tomcat、SSL、LDAP、SSO、Weblogic。 要成功地使CAS成为其他各种应用的用户的统一认证中心,就要正确的配置好CAS的服务端和客户端,在每一个需要认证的应用里面都要分别配置

hzcyclone的专栏 6096

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

CAS—认证原理

CAS,Central Authentication Service—中央认证服务,是Yale 大学发起的一个企业级的、开源的项目,旨在为Web应用系统提供一种可靠的SSO解决方案。下面简单介绍SSO,重点介绍CAS认证过程。 一、    SSO简介   1.1   概念   SSO英文全称Single Sign On,是目前比较流行的服务于企业业务整合的解决方案之一, SSO 使得在多个应

大鹏 4万+

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

Spring Security整合CAS

CAS(中央认证服务) 从结构上看,CAS 包含两个部分: CAS Server 和 CAS Client。CAS Server 需要独立部署,主要负责对用户的认证工作;CAS Client 负责处理对客户端受保护资源的访问请求,需要登录时,重定向到 CAS Server。图1 是 CAS 最基本的协议过程: CAS Client 与受保护的客户端应用部署在一起,以 Filter 方式保护受保护的资源。对于访问受保护资源的每个 Web 请求,CAS Client 会分析该请求的 Http 请求中是否

new_ord的博客 1万+

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

CAS单点登录-Central Authentication Service

简介: CAS是Central Authentication Service的缩写,中央认证服务,一种独立开放指令协议。CAS 是 耶鲁大学(Yale University)发起的一个开源项目,旨在为 Web 应用系统提供一种可靠的单点登录方法,CAS 在 2004 年 12 月正式成为 JA-SIG 的一个项目。 特点: 1、开源的企业级单点登录解决方案。 2、CAS Server 为需要独立部署的 Web 应用。 3、CAS Client 支持非常多的客户端(这里指单点登录系统中的各个 Web 应用),

greatliuda的博客 1497

Central Authentication Service (CAS) 001

CAS cas 百度文档:https://baike.baidu.com/item/CAS/1329561?fr=aladdin 文档摘取: (中央认证服务) CAS是Central Authentication Service的缩写,中央认证服务,一种独立开放指令协议。CAS 是 Yale 大学发起的一个开源项目,旨在为 Web 应用系统提供一种可靠的单点登录方法,CAS 在 200...

MINGDE_SKILL的博客 1063

基于CAS实现单点登录

CAS 一、概述 CAS是中央认证服务Central Authentication Service的简称。最初由耶鲁大学的Shawn Bayern 开发,后由Jasig社区维护,经过十多年发展,目前已成为影响最大、广泛使用的、基于Java实现的、开源SSO解决方案。 2012年,Jasig和另一个有影响的组织Sakai Foundation合并,组成Apereo。Apereo是一个由高等学术教育机...

高興 7164

【权限管理】CAS(Central Authentication Service)

CAS(Central Authentication Service)是一种广泛应用的 单点登录(SSO) 协议,它允许用户在一个集中式的身份验证系统中登录一次后,便可以无缝访问多个应用系统,而无需重复登录。CAS 通过统一的身份验证服务来简化多个应用之间的用户认证流程,提高了用户体验,并减少了管理多个用户凭证的复杂性。

IT古董 1651

【cas基础】SSO基于cas实现单点登录

概念介绍 1.定义 CAS ( CentralAuthentication Service ) 是 Yale 大学发起的一个企业级的、开源的项目,旨在为 Web 应用系统提供一种可靠的单点登录解决方法(属于 WebSSO )。   2.结构体系   从结构体系看, CAS 包括两部分: CAS Server 和 CAS Client 。 CAS Server 负责完成对用户的认证

IT Girl 5357

CAS(Central Authentication Service、中央认证服务)

CAS(Central Authentication Service、中央认证服务)是Yale大学发起的一个开源项目,旨在[color=red]为Web应用系统提供一种可靠的单点登录方法[/color],CAS 在 2004 年 12 月正式成为 [color=blue]JA-SIG[/color] 的一个项目。官网地址:[url]http://www.jasig.org/cas[/url] ...

如果你真的想做一件事,你一定会找到方法; 如果你不想做一件事,你一定会找到借口。 1914

CAS单点登录原理

之前我们谈了如何关于单点登录的一些概述,讲到了当跨域名单点登录时,CAS的设计具有参考价值,那么这篇就该谈谈CAS的具体原理了。 CAS单点登录 CAS指的是Apereo的CAS开源项目,三个字母分别是是Central Authentication Service的首字母缩写。 官方地址: 网址:https://www.apereo.org/projects/cas git:https:...

not_easy的专栏 4121
上一篇: cvc-complex-type.3.2.2: Attribute 'singleton' is not allowed to appear in element 'bean
下一篇: Docker实战-安装大数据分析与可视化平台superset(druid)
王树民
博客等级 码龄10年 912粉丝 560原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值