`
jlcon
  • 浏览: 172239 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

CAS 配置票据组件

cas 
阅读更多

配置票据组件

有两个配置票据的组件:

  • TicketRegistry - 用于票据持久化.
  • ExpirationPolicy - Provides a policy framework for ticket expiration semantics.

票据注册

The deployment environment and technology expertise generally determine the particular TicketRegistrycomponent. A cache-backed implementation is recommended for HA deployments, while the defaultDefaultTicketRegistry in-memory component may be suitable for small deployments.

默认(In-Memory) 票据注册

DefaultTicketRegistry uses a ConcurrentHashMap for memory-backed ticket storage and retrieval. This component does not preserve ticket state across restarts. There are a few configuration knobs available:

  • initialCapacity - ConcurrentHashMap initial capacity.
  • loadFactor - ConcurrentHashMap load factor.
  • concurrencyLevel - Allows tuning the ConcurrentHashMap for concurrent write support.

All three arguments map to those of the ConcurrentHashMap constructor.

<bean id="ticketRegistry"
      class="org.jasig.cas.ticket.registry.DefaultTicketRegistry"
      c:initialCapacity="10000"
      c:loadFactor="1"
      c:concurrencyLevel="20" />

 

Cache-Based 票据注册

Cached-based ticket registries provide a high-performance solution for ticket storage in high availability deployments. Components for the following caching technologies are provided:

RDBMS Ticket Registries

RDBMS-based ticket registries provide a distributed ticket store across multiple CAS nodes. Components for the following caching technologies are provided:

票据生成器

CAS presents a pluggable architecture for generating unique ticket ids for each ticket type. The configuration of each generator is defined at src\main\webapp\WEB-INF\spring-configuration\uniqueIdGenerators.xml. Here’s a brief sample:

<bean id="ticketGrantingTicketUniqueIdGenerator" class="org.jasig.cas.util.DefaultUniqueTicketIdGenerator"
        c:maxLength="50" c:suffix="${host.name}" />

<bean id="serviceTicketUniqueIdGenerator" class="org.jasig.cas.util.DefaultUniqueTicketIdGenerator"
    c:maxLength="20" c:suffix="${host.name}" />

<bean id="loginTicketUniqueIdGenerator" class="org.jasig.cas.util.DefaultUniqueTicketIdGenerator"
    c:maxLength="30" c:suffix="${host.name}" />

<bean id="proxy20TicketUniqueIdGenerator" class="org.jasig.cas.util.DefaultUniqueTicketIdGenerator"
    c:maxLength="20" c:suffix="${host.name}" />

<util:map id="uniqueIdGeneratorsMap">
    <entry
        key="org.jasig.cas.authentication.principal.SimpleWebApplicationServiceImpl"
        value-ref="serviceTicketUniqueIdGenerator" />
</util:map>

 

Components

UniqueTicketIdGenerator

Strategy parent interface that describes operations needed to generate a unique id for a ticket.

DefaultUniqueTicketIdGenerator

Uses numeric and random string generators to create a unique id, while supporting prefixes for each ticket type, as is outlined by the CAS protocol, as well as a suffix that typically is mapped to the CAS server node identifier in order to indicate which node is the author of this ticket. The latter configuration point helps with troubleshooting and diagnostics in a clustered CAS environment.

HostNameBasedUniqueTicketIdGenerator

An extension of DefaultUniqueTicketIdGenerator that is able auto-configure the suffix based on the underlying host name. In order to assist with multi-node deployments, in scenarios where CAS configuration and speciallycas.properties file is externalized, it would be ideal to simply just have one set of configuration files for all nodes, such that there would for instance be one cas.properties file for all nodes. This would remove the need to copy/sync configuration files over across nodes, again in a situation where they are externalized.

The drawback is that in keeping only one cas.properties file, we’d lose the ability to define unique host.nameproperty values for each node as the suffix, which would assist with troubleshooting and diagnostics. To provide a remedy, this ticket generator is able to retrieve the host.name value directly from the actual node name, rather than relying on the configuration, only if one isn’t specified in the cas.properties file.

SamlCompliantUniqueTicketIdGenerator

Unique Ticket Id Generator compliant with the SAML 1.1 specification for artifacts, that is also compliant with the SAML v2 specification.

Ticket Registry Cleaner

The ticket registry cleaner should be used for ticket registries that cannot manage their own state. That would include the default in-memory registry and the JPA ticket registry. Cache-based ticket registry implementations such as Memcached, Hazelcast or Ehcache do not require a registry cleaner. The ticket registry cleaner configuration is specified in the spring-configuration/ticketRegistry.xml file.

Components

RegistryCleaner

Strategy interface to denote the start of cleaning the registry.

DefaultTicketRegistryCleaner

The default ticket registry cleaner scans the entire CAS ticket registry for expired tickets and removes them. This process is only required so that the size of the ticket registry will not grow beyond a reasonable size. The functionality of CAS is not dependent on a ticket being removed as soon as it is expired. Locking strategies may be used to support high availability environments. In a clustered CAS environment with several CAS nodes executing ticket cleanup, it is desirable to execute cleanup from only one CAS node at a time.

LockingStrategy

Strategy pattern for defining a locking strategy in support of exclusive execution of some process.

NoOpLockingStrategy

No-Op locking strategy that allows the use of DefaultTicketRegistryCleaner in environments where exclusive access to the registry for cleaning is either unnecessary or not possible.

Configuration

If you’re using the default ticket registry configuration, your /cas-server-webapp/WEB-INF/spring-configuration/ticketRegistry.xml probably looks like this:

<!-- TICKET REGISTRY CLEANER -->
<bean id="ticketRegistryCleaner" 
  class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner"
      c:centralAuthenticationService-ref="centralAuthenticationService"
      c:ticketRegistry-ref="ticketRegistry"/>

<bean id="jobDetailTicketRegistryCleaner"  
      class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"
    p:targetObject-ref="ticketRegistryCleaner"
    p:targetMethod="clean" />

<bean id="triggerJobDetailTicketRegistryCleaner" 
      class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean"
    p:jobDetail-ref="jobDetailTicketRegistryCleaner"
    p:startDelay="20000"
    p:repeatInterval="5000000" />

 

Ticket Expiration Policies

CAS supports a pluggable and extensible policy framework to control the expiration policy of ticket-granting tickets (TGT) and service tickets (ST). See this guide for details on how to configure the expiration policies.

分享到:
评论

相关推荐

    WAS与CAS配置

    在IBM WebSphere Application Server(WAS)环境中配置与Central Authentication Service(CAS)实现单点登录(SSO)是一个涉及多个组件和步骤的过程。首先需要了解的是,WAS是一个广泛应用于IBM Tivoli软件产品中的...

    CAS Service 5.2.x 数据库连接REST已经配置

    CAS Server是核心组件,负责处理用户的认证请求,验证凭证,并向服务提供授权票据。在5.2.x版本中,CAS引入了RESTful API,这使得系统配置和管理更加灵活,可以通过HTTP请求直接操作。 对于MySQL数据库的配置,CAS...

    cas 配置client 1.0 &2.0 及proxy DEMO 说明

    【CAS配置client 1.0 & 2.0及proxy DEMO说明】 CAS(Central Authentication Service)是一种基于Web的单点登录(Single Sign-On, SSO)协议,它允许用户通过一个认证入口登录,然后访问多个受保护的应用系统,而...

    cas单点登录配置及资源

    理解其工作原理,正确配置相关组件,结合提供的jar包和war包,以及配置文档,可以有效地搭建和维护一个安全的CAS单点登录环境。在实际操作中,可能还会遇到各种问题,关键在于细致排查和不断学习。

    SSO单点登陆CAS配置手册.doc

    在这个过程中,`deployerConfigContext.xml` 是 CAS 服务器的核心配置文件,它定义了 CAS 的各种组件和服务,包括认证、授权、票据管理等。通过修改这个文件,可以定制 CAS 服务器的行为以适应特定的需求。 数据库...

    cas集成AD域

    在客户端应用中,需要配置CAS客户端库,以处理CAS的登录流程,包括重定向用户到CAS服务器进行登录,以及解析返回的票据。 5. **测试和调试**:完成配置后,可以通过测试登录流程来检查集成是否正确。如果一切正常,...

    Spring Security 3 与 CAS单点登录配置.doc

    `casFilter` 是一个 Filter,用于处理 CAS 服务票据。 使用 Spring Security 3 配置 CAS 单点登录需要配置 Client、`casEntryPoint` 和 `casFilter`。这三个组件一起工作,提供了安全、灵活的身份验证和授权功能。

    CAS单点登录的配置

    CAS的核心组件包括客户端和服务端。客户端是用户访问的应用系统,它们通过集成CAS客户端库来实现对用户的认证请求。服务端是CAS服务器,负责处理认证请求,验证用户凭证,并返回认证结果。 **二、安装与配置CAS...

    SSO\CAS 单点登录配置手册

    ### SSO/CAS 单点登录配置手册 #### 一、单点登录(SSO)概述 单点登录(Single Sign-On, SSO)是一种让用户只需一次登录就能访问多个应用系统的认证方式。它不仅提升了用户体验,同时也提高了系统的安全性,因为用户...

    cas.rar_cas java_cas服务端代码_单点登录

    4. CAS服务端代码:压缩包中的“cas”目录很可能包含了CAS服务器的核心组件代码,包括认证模块、票据管理、服务注册与管理等。这些代码可以帮助开发者深入理解CAS的工作机制,例如如何处理HTTP请求,如何验证用户...

    cas-client-core-3.3.3

    - 在Spring配置文件中添加上述的CAS配置。 - 在Web安全配置中启用CAS过滤器链,如使用`httpSecurity.casAuthenticationFilter()`。 - 配置CAS服务器URL、服务URL、票证验证URL等。 - 测试应用,确保SSO功能正常...

    单点登入--CAS3.0

    - 应用系统需要集成CAS客户端库,配置服务URL和CAS服务器地址,以便进行票据交换和验证。 **安全性考虑:** - CAS3.0支持HTTPS协议,确保通信过程中的数据安全。 - 票据加密:服务票据和代理票据通常会被加密,...

    CAS JPA-Ticket存储解决负载均衡配置

    【配置JPA存储实现CAS票据共享】 JPA提供了一种标准的方式来管理对象-关系映射,使得我们可以将Ticket对象持久化到数据库中。在CAS 3.5.2版本中,可以配置JPA Ticket Registry以存储Ticket并实现在多个CAS Server...

    springboot+security+cas集成demo

    成功后,CAS返回一个服务票据,Spring Security会用这个票据向CAS服务器换取用户票据,进而完成认证。授权则可以通过Spring Security的角色和权限控制实现。 5. **自定义逻辑**:可能需要根据实际需求扩展或定制...

    cas-3.5.3 api 和cas-client-core-3.3.3 api chm

    在API中,你可以找到关于CAS服务验证、票据管理、配置选项以及与外部系统集成的关键类和接口的描述。例如,`AuthenticationManager` 接口用于处理用户认证,`TicketGrantingTicket` 类代表用户的一次会话,`...

    myeclipse、tomcat集成CAS

    3. **配置CAS客户端**:在项目的配置文件(如`web.xml`)中添加CAS过滤器和监听器,这些组件负责拦截请求,与CAS服务器交互,并处理登录和登出事件。你需要指定CAS服务器的URL,以及服务验证和登出的端点。 4. **...

    cas-server-3.4.10-release和cas-client-3.2.1-release两个

    标题提到的"cas-server-3.4.10-release"和"cas-client-3.2.1-release"是CAS协议的两个关键组件:服务器端和客户端。 **CAS服务器端(cas-server-3.4.10-release)** CAS服务器是整个系统的核心,它负责处理用户的...

    cas 普通方式和SpringBoot方式客户端 普通方式服务端

    CAS服务器的核心组件包括认证器(用于验证用户身份)、票据管理器(用于创建和验证票证)、以及服务注册表(记录了哪些服务可以使用CAS进行身份验证)。 在Spring Boot方式下,集成CAS更加简化。Spring Boot提供了...

    cas.zip_cas 结合 springmvc shiro 做项目单点认证

    3. **Shiro集成**:在SpringMVC应用中,引入Shiro依赖,并配置Shiro Realm,使其能够处理CAS服务票据。Shiro Realm将从CAS服务器获取的Ticket与本地用户信息进行比对,完成本地认证。 4. **处理登录和登出**:当...

Global site tag (gtag.js) - Google Analytics