`

单点登录 - CAS【六】renew、gateway

 
阅读更多

一、Renew: Opting out of SSO

    看下官方网站上的描述 

There is a feature of the CAS protocol that allows clients to opt out of single sign on. This feature is called renew. It allows a client to advise the CAS server login to always authenticate a user regardless of whether a single sign on session already exists.

This is a useful feature for when there are certain services that would like to use CAS as the authentication mechanism but allow access to sensitive material. They can force CAS to reauthenticate a user to ensure that they are signing in the correct user (and its not a pre-existing SSO session that wasn't terminated.

To tell CAS to renew the credentials, the client application should redirect the user with a URL similar to the following:

https://server/cas/login?service=serviceUrl&renew=true

When requesting validation of a ticket, a client can ask it to ensure that the ticket is from a new authentication request.

大意如下吧:

CAS协议允许客户端选择是否跳出单点登录(强制重新登录),这就是renew。它允许一个客户端通知CAS服务器总是验证一个用户,不管一个单点登录的session是否存在。这是一个非常有用的属性,当一个特定的使用CAS认证机制的服务允许访问敏感资料时,它能强迫CAS重新认证一个用户,确保登录的是一个正确的用户。这时,那个应经存在的单点登录session应该是被终止的。使用这个属性通知CAS重新验证凭证时,客户端应用应该重定向用户到以下的URL上:https://server/cas/login?service=serviceUrl&renew=true。当请求验证这个票据时,客户端可以要求CAS确保这个票据是来自一个新的认证请求。

 

二、Gateway

   

This page documents the Gateway feature of the CAS protocol and the protocol-implementing CAS Server.

What is the Gateway feature?

CAS Server includes a feature whereby you can set the request parameter "gateway" to "true" on the request for CAS login. If "gateway" is "true", then CAS will not paint the user login screen. If it can accomplish authentication by single sign on - that is, by detecting the CAS ticket granting cookie - then it will redirect to the URL specified by the "service" parameter with a valid service ticket. If it cannot accomplish single sign on, then it will redirect to the "service" URL without painting any login screen.

This allows your application to detect and take advantage of user single sign on without bothering the user with a login screen in the case where he or she is not yet logged on. This is useful for main pages and is probably a "best practice", since it allows the user to learn about the service to which he might authenticate before being abruptly presented with the CAS login screen out of context.

What is required of a CAS Client to support this feature?

A gateway-supporting CAS client should:

  1. provide a mechanism for the application developer/deployer/htaccess writer to elect the gateway behavior
  2. when gateway is elected:
    1. set the request parameter "gateway" to be "true" on the CAS login request
    2. provide a way to indentify the request when it is redirected back from CAS as one that has already been gatewayed (e.g., a special parameter on the URL-encoded "service", setting a cookie, using already-present session support from your environment, etc.)
  3. receive requests redirected back from CAS. These may have the "ticket" parameter set, in which case validate the ticket, etc. If gatewaying failed to pick up a single sign on session, the request will be for the URL specified as the "service" parameter "bare" - the "ticket" parameter will not be set, and CAS does not set any other parameter to indicate that it had gatewayed. The client needs to recognize the request as having already come through gateway. The client should not redirect already-gatewayed requests back to CAS for more gatewaying, because this will lead to an infinite loop of redirecting back and forth between server and client.

CAS is authentication, not authorization. The standard use case for CAS is that the client application wants to consume the authenticated username. Under gateway, when there is no authenticated username because we came back from CAS ticketless, the client should do something like returning "null" when the client application asks for the authenticated username, or fail to set the remote user header, or put null into the session where the application expected to lookup the authenticated user, etc., as applicable to the CAS client implementation.

In the case where one is using CAS for authorization (probably a bad idea in the first place) - users able to authenticate are authorized to access the resource, and users unable to authenticate are not authorized - then GATEWAY should not be used.

 

    如果设定这个参数,CAS将不会向客户端索要凭据 

  • 如果客户端有一个已存在的CAS单点登录的session,或者如果单点登录session可以通过非交互方式(i.e. trust authentication,信托认证)建立,CAS可以将客户端请求重定向到“service”参数指定的URL,而且还加上有效的服务票据(Service Ticket,ST)。 (CAS还可以插入一个通知页面,通知客户端一个CAS认证已经发生了。)
  • 如果客户端没有CAS单点登录的session,并且也不可能通过非交互方式建立认证,CAS必须将客户端重定向到“service”参数指定的URL,并且不在URL后面附加“ticket”。
  • 如果“service”参数未指定但设置了“gateway”参数,CAS将认为这种行为未定义。在这种情况下推荐:CAS应要求客户端凭据就好像两个参数都没有指定。
  • 同样这个参数与“renew”参数不兼容。如果要设置“gateway”参数,推荐设置为“true”。
  • 总结:“renew”参数的作用:在存在SSO session的情况下,当client请求访问资源,renew参数控制CAS认证服务器重新认证用户信息、还是不用认证放这个请求过去。
  • 总结:“gateway”参数的作用:与“renew”参数相反,“gateway=true”时是指只要存在SSO session就不用重新认证了。
  • 总结:Renew始终要求用户进行主认证,所谓主认证就是借助于/login进行的认证操作,此时IE用户必须手工提供自身的帐号信息。基于TGC、PT的登录都不属于主认证
  • 相比之下,gateway始终不会允许CAS服务器丢出/login登录页面给IE用户,从而不可能进行主认证。只要gateway=true则永远进不到/login登录页面,只有确认用户能从其他途径得到SSO session才可以设置true

 

 

 

 

分享到:
评论
1 楼 skying007 2015-07-13  
博主你好,我想用cas 实现,相同用户登录,后者把前者踢掉,这样的效果,有什么好的思路吗?还是可以配置就可以了。谢谢。

相关推荐

    Microsoft365-E5-Renew-Plus-with-runtime.rar

    这个压缩包文件"Microsoft365-E5-Renew-Plus-with-runtime.rar"很可能包含了与Microsoft 365 E5相关的更新、扩展功能或者运行时环境。 在深入讨论之前,我们先理解一下"Renew Plus"的概念。这通常意味着该订阅服务...

    CAS单点登录

    `Renew`参数允许客户端强制CAS服务器验证用户,无论是否已存在单点登录session。这对于某些场景非常有用,比如需要确保用户在每次访问特定服务时都需要重新验证身份。 总之,CAS单点登录系统通过TGT和ST的机制,...

    Lets-Encrypt-Smart-Renew, 续订前检查证书的剩余有效期.zip

    Lets-Encrypt-Smart-Renew, 续订前检查证书的剩余有效期 Lets-Encrypt-Smart-Renew续订前检查证书的剩余有效期。有关详细信息,请参阅我的博客文章这里。 官方让我们加密文档,以及我关于的文章,让我们加密 ! ,...

    k8s-ecr-login-renew:续订AWS ECR容器注册表的Docker登录凭证

    最新的图像是: nabsul/k8s-ecr-login-renew:v1.5 nabsul/k8s-ecr-login-renew:arm32v7-v1.5环境变量该工具主要通过环境变量进行配置。 这些都是: AWS_ACCESS_KEY_ID(必需):用于创建Docker凭证的AWS访问密钥

    2020-03-03renew hospitalCAD_2019.11.30whole follow -1977 .sav

    2020-03-03renew hospitalCAD_2019.11.30whole follow -1977 .sav

    Renew MS-700 certificate

    Renew MS-700 certificate

    CAS Protocol 3.0 Specification.docx 官方中文版教程详解

    CAS(Central Authentication Service)是一种网络单点登录(SSO)/单点登出(SLO)协议。它的主要目的是在用户访问多个应用程序时,只需向中央CAS服务器提供一次凭证,如用户名和密码,从而简化身份验证流程。CAS...

    paysys-shop-renew:Paysys商店续订版本

    在压缩包文件"paysys-shop-renew-main"中,"main"通常指的是项目的主分支或者主要代码库。这可能是整个项目的源代码,包括业务逻辑、视图层、数据模型、API接口调用等各个组成部分。TypeScript代码可能会按照模块化...

    比较详细的中文cas协议介绍

    CAS协议是一种用于单点登录(SSO)场景的身份验证协议,广泛应用于SOA(面向服务的架构)环境中,支持不同服务之间的无缝集成。以下是对CAS协议关键知识点的深入解析: ### 重要概念 - **Ticket**:CAS协议的核心...

    cas-client-core-3_asleepb5x_CAS_源码.rar

    CAS(Central Authentication Service)是一种基于Web的单点登录(Single Sign-On, SSO)协议,它允许用户在多个应用系统中只需登录一次,即可访问所有相互信任的应用系统,而无需再次输入认证信息。CAS客户端的核心...

    sso单点登录

    casServerLoginUrl 是CAS服务器登录的地址; casServerUrlPrefix 是CAS服务器地址 serverName 子系统URL地址 Forms验证的loginUrl地址 <forms loginUrl=...

    shib-cas-authn2:Shibboleth IDP 外部身份验证插件,将身份验证委托给中央身份验证服务器

    与 Shibboleth 提供的普通REMOTE_USER标头解决方案相比,使用此组件的最大优势是能够利用完整的本地 CAS 协议功能,例如renew和gateway 。 该插件由 2 个组件组成: 委托给 CAS 的自定义 Shibboleth LoginHandler...

    cas原理 webflow mvc ioc

    CAS(Central Authentication Service)是一种单点登录(Single Sign-On,SSO)协议,旨在简化多应用环境下的用户身份验证过程。它通过引入中央认证服务器(CAS Server)的概念,为各个服务或应用提供统一的身份验证...

    Renew (AZ-700) Azure Network Engineer Associate更新

    当你在VNet1中有虚拟网络网关,并希望VNet2和VNet3的流量通过VNet1的网关路由时,你需要在VNet1到VNet2和VNet1到VNet3的对等连接上启用"Use the remote virtual network's gateway"设置。这使得其他VNet能够利用VNet...

    hetzner-letsencrypt-wildcard-auto-renew:这些脚本将通过DNS挑战自动更新通配符证书,其中区域文件位于Hetzner机械手中

    让我们用Hetzner区域文件DNS挑战加密通配符...脚本需要知道您的登录数据和certbot-auto的安装路径才能正常运行。 必须在certbot.py文件中设置certbot-auto的安装路径。 只需编辑CERTBOT_AUTO全局变量。 可以在hetzner.

    moving-to-serverless-renew:转向无服务器示例应用程序更新项目

    迁移到AWS无服务器。欢迎! 该研讨会的内容将处理基于服务器的Python Flask Web应用程序,并展示如何使用AWS Chalice微框架迁移到无服务器架构应用程序。 它涉及如何从实用的应用程序级别逐步将应用程序源代码从基于...

    E5Renew:Python-Microsoft Graph API-E5Renew

    E5Renew:Python-Microsoft Graph API-E5Renew

    华为H3C认证客户端 For linux

    本人亲测,Ubuntu下完美! ------------------------- ... -r --renew renew IP address. -h --help diaplay usage. -k --kill disconnect. -u --user username/password 更新地址:http://www.flyx.cn/xclient

    SC-200 Renew考试题目.xlsx

    此文档可以帮助您尽快获得MCP认证,可以节省您的备考时间,降低考试挂科的概率。 希望您尽快成为MCP认证工程师,尽早在职场中发光发热。

    Python库 | mysql_renew-0.1.1-py3-none-any.whl

    《Python库mysql_renew-0.1.1-py3-none-any.whl详解与应用》 在Python的世界里,库是开发者的重要工具,它们提供了丰富的功能,帮助我们更高效地编写代码。今天我们要探讨的是一款名为`mysql_renew`的Python库,其...

Global site tag (gtag.js) - Google Analytics