Active directory 单点登录(SSO):如何使用Active Directory作为CAS服务的身份验证方法?
我正在开发Liferay的门户,并希望在那里应用单一登录机制(SSO)。我使用它对我的多个web应用程序进行集中身份验证。到目前为止,我知道我可以使用CAS作为身份验证方法,但下一步将是添加更多的智能并从Active Directory服务器请求身份验证 这应该可以通过使用AD作为进行身份验证的“数据库”来实现,但我对这些东西还不熟悉,不知道如何使用Jasig CAS实现这一点Active directory 单点登录(SSO):如何使用Active Directory作为CAS服务的身份验证方法?,active-directory,single-sign-on,cas,Active Directory,Single Sign On,Cas,我正在开发Liferay的门户,并希望在那里应用单一登录机制(SSO)。我使用它对我的多个web应用程序进行集中身份验证。到目前为止,我知道我可以使用CAS作为身份验证方法,但下一步将是添加更多的智能并从Active Directory服务器请求身份验证 这应该可以通过使用AD作为进行身份验证的“数据库”来实现,但我对这些东西还不熟悉,不知道如何使用Jasig CAS实现这一点 有没有完成这项任务的线索?我在这里做一些假设,所以如果我偏离目标,请告诉我: 您使用的CAS版本介于3.3.2和3.4
有没有完成这项任务的线索?我在这里做一些假设,所以如果我偏离目标,请告诉我:
- 如果要通过“ldaps://”(而不是“ldap://”)绑定到AD,则CAS服务器上的JVM需要信任Active Directory服务器的SSL证书。如果您正在为AD使用自签名证书,则需要将其导入JVM的信任存储
- cas服务器webapp/pom.xml
- cas服务器webapp/src/main/webapp/WEB-INF/deployerConfigContext.xml
中添加以下内容:
${project.groupId}
+1:完美答案!当我有时间编写代码时,我将检查这是如何实现的。万分感谢!这里有一个小问题:active directory使用LDAP协议?正确--
<!-- LDAP support -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cas-server-support-ldap</artifactId>
<version>${project.version}</version>
</dependency>
<bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" p:httpClient-ref="httpClient" />
<!-- LDAP bind Authentication Handler -->
<bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler">
<property name="filter" value="uid=%u" />
<property name="searchBase" value="{your LDAP search path, e.g.: cn=users,dc=example,dc=com}" />
<property name="contextSource" ref="LDAPcontextSource" />
<property name="ignorePartialResultException" value="yes" /> <!-- fix because of how AD returns results -->
</bean>
<bean id="LDAPcontextSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="pooled" value="false"/>
<property name="urls">
<list>
<value>{URL of your AD server, e.g.: ldaps://ad.example.com}/</value>
</list>
</property>
<property name="userDn" value="{your account that has permission to bind to AD, e.g.: uid=someuser, dc=example, dc=com}"/>
<property name="password" value="{your password for bind}"/>
<property name="baseEnvironmentProperties">
<map>
<entry>
<key>
<value>java.naming.security.authentication</value>
</key>
<value>simple</value>
</entry>
</map>
</property>
</bean>