我正在使用带有JDBC身份验证处理程序的CAS,并且想知道在成功进行身份验证后,是否可以获取主体对象的其他属性(例如firstname,lastname),而不仅仅是CAS中的用户名?
我正在开发Liferay的门户网站,并希望在那里应用单点登录机制(SSO).我正在使用Jasig CAS对我的多个Web应用程序进行集中身份验证.到目前为止,我知道我可以使用CAS作为身份验证方法,但下一步是添加更多智能并从Active Directory服务器请求身份验证.
这可以通过使用AD作为进行身份验证的"数据库"来实现,但我是新手,并且不知道如何使用Jasig CAS.
有任何线索如何完成这项任务?
我们正在尝试将CAS服务器用于我们现有的基于Web的应用程序的SSO.我们的目标是
我们完成了第一个和第二个目标.但是遇到第三个问题.
对于此功能,我们尝试复制与第二个目标相同的操作,唯一的区别是从非CAS登录页面提交/发布数据(凭据,登录票证等).
关于我们如何处理这个问题的任何想法?
谢谢,Pratik
我使用Angular 5作为Spring Boot REST服务器的前端.如果不使用SSL,一切都正常.当我切换到SSL时,最终我得到了一切工作.它适用于GET请求,但到目前为止,我无法获得PUT请求.
我的猜测是,这是某种CORS问题,因为GET是一个简单的请求而PUT显然不是(CORS参考),但我无法弄清楚如何解决问题.
在我的Spring Boot Rest控制器上,我有注释@CrossOrigin("*"),所以我不认为这是问题,但我不确定.
另一个难题是通过CAS服务器处理身份验证.我已将以下配置添加到CAS属性中.这些是允许GET请求工作的最后一块,但我不确定要对它们进行哪些更改(如果有的话)来处理PUT请求:
cas.httpWebRequest.cors.enabled=true
cas.httpWebRequest.cors.allowOrigins[0]=*
cas.httpWebRequest.cors.allowMethods[0]=*
cas.httpWebRequest.cors.allowHeaders[0]=*
Run Code Online (Sandbox Code Playgroud)
这是我的请求标头和响应:
请求:
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Content-Length: 1975
Content-Type: application/json
Cookie: JSESSIONID=117D9345E985D824E46…BF32; io=gLhCcBoZrfNcppioAAAB
Host: localhost:4200
Referer: https://localhost:4200/sales/proposals/dashboard
User-Agent: Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/57.0
Run Code Online (Sandbox Code Playgroud)
回应(状态代码 - 403禁止):
access-control-allow-origin: *
cache-control: no-cache, no-store, max-age=0, must-revalidate
content-length: 56
content-type: application/json;charset=UTF-8
date: Wed, 03 Jan 2018 16:39:14 GMT
expires: 0
pragma: no-cache
strict-transport-security: max-age=31536000 ; includeSubDomains
x-content-type-options: …Run Code Online (Sandbox Code Playgroud) 在我的java-play应用程序中,我@RequiresAuthentication(clientName = "CasClient")在控制器中有注释.
我只想在生产环境中验证用户身份.
如何有条件地应用注释?
如果我接近身份验证的方式是错误的,那么只在java play应用程序中生成CAS身份验证的常规方法是什么?
我有这个问题也在这里描述.问题是我创建了一个证书并将其添加到tomcat的密钥库中,然后我将其复制到cacerts信任库.但是,不知怎的,我仍然得到这个错误.
我做了什么:
1)keytool -genkey -alias cas -keyalg RSA -keystore cas.keystore -storepass changeit
2)keytool -exportcert -alias cas -file cas.crt -keystore cas.keystore
步骤2)因为我想把证书放在我的tomcat密钥库中 cacerts
3)keytool -import -alias cas -file cas.crt -keystore"C:\ Program Files\Java\jdk1.8.0_77\jre\lib\security\cacerts"
4)keytool -import -alias cas -file"C:\ Program Files\Java\jdk1.8.0_7\jre\bin\cas.crt"-keystore"D:\ portal\apache-tomcat-8.0.3\conf\portal.keystore"
所以现在使用第3步和第4步,我在tomcat密钥库和信任库中添加了证书cacerts.
现在我可以列出我的信任和密钥库
使用此命令..
keytool -list -v -keystore"C:\ Program Files\Java\jdk1.8.0_77\jre\lib\security\cacerts"-alias cas
......我明白了:
Keystore-Kennwort eingeben:
Aliasname: cas
Erstellungsdatum: 09.09.2016
Eintragstyp: trustedCertEntry
Eigentümer: CN=xxx, OU=xxx, O=xxx, L=xxx, ST=xxx, C=xxx
Aussteller: CN=xxx, OU=xxx, O=xxx, L=xxx, ST=xxx, C=xxx
Seriennummer: xxx …Run Code Online (Sandbox Code Playgroud) 任何人都可以粘贴简单的步骤,将Spring安全性和CAS集成到此处进行单点登录和单点注销.注意我不想要任何基于角色的访问.我有一个已经与spring security集成的Web应用程序.现在我试图用CAS执行SSO,但是我收到了这个错误 sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
这是我目前的spring security.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd
">
<sec:http entry-point-ref="casProcessingFilterEntryPoint" >
<sec:intercept-url pattern="/**" access="ROLE_USER" />
<sec:logout logout-success-url="/loggedout.jsp" invalidate-session="true"/>
<sec:custom-filter ref="casAuthenticationFilter" after="CAS_FILTER"/>
</sec:http>
<sec:authentication-manager alias="authenticationManager">
<sec:authentication-provider ref="casAuthenticationProvider"/>
</sec:authentication-manager>
<bean id="casAuthenticationFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter">
<property name="authenticationManager" ref="authenticationManager"/>
<property name="authenticationFailureHandler">
<bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
<property name="defaultFailureUrl" value="/casfailed.jsp"/>
</bean>
</property>
<property name="authenticationSuccessHandler">
<bean …Run Code Online (Sandbox Code Playgroud) 我知道CAS和SAML是用于单点签名的不同协议,但让我感到困惑的是"CAS具有SAML实现"的文章.
CAS和SAML是不是可以实现单点登录的不同方式?
可以说,客户的企业有SAML服务器,但第三方网站称他们支持基于CAS的SSO.在这种情况下,最终用户最初会登录到企业系统,当访问第三方网站时,它是否会连接到企业SAML服务器以寻找SAML断言?
- CAS和SAML之间究竟有什么关系?
- CAS在上述设置中究竟在哪里?
在我们公司,我们部署了多个使用CAS服务器通过SSO保护的Web应用程序.用户请求应用程序的URL,如果尚未经过身份验证,则会重定向到CAS服务器登录页面.在成功验证的情况下,用户将被重定向回最初请求的URL.常见的工作流程,完美运作
但是,我们还希望使用CAS Server保护我们的REST Apis.我们的首选流程如下:
听起来像OA服务器,CAS服务器确实支持,除了不要求用户随时提供凭据,但我们也想为服务提供身份验证,即调用我们的API的其他应用程序:
我们希望我们的REST Api应用程序对用户凭据一无所知,甚至无法访问用户数据库,这对于使用该应用程序的人来说效果很好(重定向到CAS登录页面).
我不知道如何在不必大量定制CAS服务器的情况下实现此流程并自行实现此行为.
谷歌使用JWT for OAuth 2.0用于服务器到服务器应用程序,这似乎是要走的路.
如果有人能提供一些提示或替代方案(对CAS服务器),我将不胜感激.也许有人已经使用CAS服务器实现了这种模式,并且可以提供有关此问题的一些信息.
最诚挚的问候,Marco