简体   繁体   English

以CAS和SAML2 SSO为例

[英]CAS and SAML2 SSO by example

We have about a dozen internal admin web apps (mostly Java) that employees use for various workflows, and each of them have their own, disparate sign-in/authentication systems. 我们有大约十二个内部管理Web应用程序(主要是Java)供员工用于各种工作流,并且每个应用程序都有各自不同的登录/身份验证系统。 I've been asked to federate them all together under a single sing-on system. 我被要求在一个单一的单一系统上将它们全部联合在一起。 I was handed the following diagram to use as a starting point: 我收到了下图,以此作为起点:

在此处输入图片说明

As you can see, each app uses a CAS client to connect to a CAS server. 如您所见,每个应用程序都使用CAS客户端连接到CAS服务器。 This server also has Apache httpd with a Shibboleth plugin (?) configured. 该服务器还具有配置了Shibboleth插件(?)的Apache httpd。 This CAS server then communicates with our Active Directory ("AD") server. 然后,该CAS服务器与我们的Active Directory(“ AD”)服务器进行通信。

I need to make sure I completely understand how these technologies all work together: 我需要确保我完全了解这些技术如何协同工作:

  • What is happening between the CAS server and Apache/Shibboleth? CAS服务器和Apache / Shibboleth之间发生了什么?
  • What is happening between Apache/Shibboleth and the "Trust Store"? Apache / Shibboleth与“信任商店”之间发生了什么?
  • What is being communicated between the CAS server and AD? CAS服务器和AD之间正在传达什么?
  • What is stored in this SAML2 token being sent back from the CAS server to each CAS client? 该SAML2令牌中存储的内容将从CAS服务器发送回每个CAS客户端吗?
  • How can I, as a Java developer, do with the SAML2 token (or lack thereof if auth fails) to actually sign users in with? 作为Java开发人员,我该如何使用SAML2令牌(如果身份验证失败则缺少SAML2令牌)来实际使用用户登录?
  • Are there any better technology choices here: if so what are they, and why? 这里是否有更好的技术选择:如果是,它们是什么?为什么? Bear in mind that all of these are Java apps, except one of them, which is a C#.NET app. 请记住,所有这些都是Java应用程序,但其中一个是C#.NET应用程序。

Here are a few of your answers: 以下是您的一些答案:

First, let me give you a quick overview of how the interaction between a CAS client and a CAS server normally works: (I am not familiar with the Shibboleth portion, so I am omitting that.) 首先,让我简要概述一下CAS客户端和CAS服务器之间的交互如何正常工作:(我不熟悉Shibboleth部分,因此省略了它。)

  1. User hits the application webpage. 用户点击应用程序网页。
  2. application redirects user to CAS. 应用程序将用户重定向到CAS。
  3. CAS, using standard cookies and sessions, determines if user is already logged in. CAS使用标准cookie和会话来确定用户是否已经登录。
  4. if User is not logged in, CAS displays a login form for the user to provide login credentials. 如果未登录用户,则CAS将显示一个登录表单供用户提供登录凭据。 IF the user is already logged in, CAS skips to step #7. 如果用户已经登录,则CAS跳至步骤7。
  5. CAS then interacts with the AD to verify that the provided credentials are valid. 然后,CAS与AD交互以验证所提供的凭据有效。
  6. if they are, then CAS logs in the user. 如果是,则CAS登录用户。
  7. then CAS will redirect back to the application, providing a ticket. 然后CAS将重定向回应用程序,并提供票证。
  8. The application makes a direct call to CAS to validate the provided ticket. 该应用程序直接致电CAS以验证所提供的票证。
  9. If the ticket is valid, then CAS returns user information as a response to the request. 如果票证有效,则CAS返回用户信息作为对请求的响应。
  10. The application then creates an authenticated session for the user, potentially looking up user information based on the info provided by CAS, and redirects them wherever is appropriate. 然后,该应用程序为用户创建一个经过身份验证的会话,从而有可能根据CAS提供的信息来查找用户信息,并在适当的地方将其重定向。

Now for your questions: 现在为您的问题:

  • CAS and AD : CAS will actually login to AD and use the user provided credentials to find and authenticate the user. CAS和AD:CAS实际上将登录到AD,并使用用户提供的凭据来查找和验证用户。 If you are using a forest, make sure you use the correct port to log into the Global Catalog, as that is easy to miss. 如果使用的是林,请确保使用正确的端口登录到全局目录,因为这很容易丢失。
  • The contents of the token are not significant, as the standard CAS protocol will send the token back to CAS and retrieve user details in the response. 令牌的内容并不重要,因为标准的CAS协议会将令牌发送回CAS并在响应中检索用户详细信息。
  • As a developer, this is actually very little you can do with the token, as it is tied to the application and can only be used once, and, for security reasons, has to be used within a very short amount of time (ie, sent back to CAS to be validated) or it will expire. 作为开发人员,使用令牌实际上无济于事,因为令牌已绑定到应用程序,并且只能使用一次,并且出于安全原因,必须在很短的时间内使用(即,发送回CAS进行验证),否则它将过期。

If you are doing primarily CAS and you have the ability to do your own CAS clients in your applications, CAS can be a very nice solution. 如果您主要从事CAS并且可以在您的应用程序中拥有自己的CAS客户,那么CAS可能是一个很好的解决方案。 Unfortunately, CAS does not have full SAML2 support, using it's own protocol instead, though CAS's protocol is very similar to the ARTIFACT profile for SAML2. 不幸的是,尽管CAS的协议与SAML2的ARTIFACT配置文件非常相似,但CAS并没有使用它自己的协议来完全支持SAML2。 If you want to integrate with other SAML2 clients, some work needs to be done. 如果要与其他SAML2客户端集成,则需要完成一些工作。

Also, if your java applications happen to use Spring, Spring security includes a CAS client out of the box. 另外,如果您的Java应用程序恰好使用Spring,则Spring安全性包括开箱即用的CAS客户端。

It is also pretty easy to write a custom client as you can see that the protocol is not terribly complex. 编写自定义客户端也很容易,因为您可以看到协议并不十分复杂。

Also, while it is a bit more work and can be a pain to set up, if your employees already login to your domain via windows, then you can actually piggy back on that and configure CAS to use the windows login information users have already provided rather than prompting users with a login form making them re-enter their windows credentials. 另外,虽然工作量更大,并且设置起来可能很麻烦,但是如果您的员工已经通过Windows登录到您的域,那么您实际上可以承担此费用,并将CAS配置为使用用户已经提供的Windows登录信息而不是使用登录表单提示用户,使他们重新输入Windows凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM