spring-security 需要有关CAS身份验证与Spring集成的帮助

hkmswyz6  于 2022-11-11  发布在  Spring
关注(0)|答案(1)|浏览(190)

我正在尝试使用CAS身份验证配置Spring安全性。
我在pom.xml中提供了以下依赖项-

<dependency>
<groupId>org.jasig.cas.client</groupId>
<artifactId>cas-client-core</artifactId>
<version>3.1.11</version>
<scope>runtime</scope>
<type>jar</type>
</dependency>

我尝试在spring-securaity.xml中配置cas客户端,但出现错误

The prefix "p" for attribute "p:casServerLoginUrl" associated with an element type "bean" is not bound.

以下是spring.security.xml文件

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="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.0.3.xsd">
<bean
name="authenticationFilter"
class="org.jasig.cas.client.authentication.AuthenticationFilter"
p:casServerLoginUrl="https://localhost:8443/cas/login"
p:renew="false"
p:gateway="false"
p:service="https://my.local.service.com/cas-client" />

<bean
name="ticketValidationFilter"
class="org.jasig.cas.client.validation.Cas10TicketValidationFilter"
p:service="https://my.local.service.com/cas-client">
<property name="ticketValidator">
<bean class="org.jasig.cas.client.validation.Cas10TicketValidator">
<constructor-arg index="0" value="https://localhost:8443/cas" />
</bean>
</property>
</bean>

<bean
name="ticketValidationFilter"
class="org.jasig.cas.client.validation.Saml11TicketValidationFilter"
p:service="https://my.local.service.com/cas-client">
<property name="ticketValidator">
<bean class="org.jasig.cas.client.validation.Saml11TicketValidator">
<constructor-arg index="0" value="https://localhost:8443/cas" />
</bean>
</property>
</bean>

<bean
name="ticketValidationFilter"
   class="org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter"
p:service="https://my.local.service.com/cas-client">
<property name="ticketValidator">
<bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<constructor-arg index="0" value="https://localhost:8443/cas" />
</bean>
</property>
</bean>

<bean
name="ticketValidationFilter"   class="org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter"
p:service="https://my.local.service.com/cas-client"
p:proxyReceptorUrl="/proxy/receptor">
<property name="ticketValidator">
<bean
class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"
p:proxyCallbackUrl="/proxy/receptor">
<constructor-arg index="0" value="https://localhost:8443/cas" />
</bean>
</property>
</bean>
<bean
name="ticketValidationFilter"
class="org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilte"    p:service="https://my.local.service.com/cas-client"
p:proxyReceptorUrl="/proxy/receptor">
<property name="ticketValidator">
<bean class="org.jasig.cas.client.validation.Cas20ProxyTicketValidator"
p:acceptAnyProxy="true"
p:proxyCallbackUrl="/proxy/receptor">
<constructor-arg index="0" value="https://localhost:8443/cas" />
</bean>
</property>
</bean>

</beans:beans>
我怀疑它的命名空间有问题。有人能帮我纠正命名空间或如果我需要改变任何东西吗?
任何人都可以参考一些在线CAS集成与Spring的安全材料,以便我可以检查和实施相同的。
我们将非常感谢您对此提供的任何帮助。

mcvgt66p

mcvgt66p1#

您需要按以下方式更改它:

<bean
name="authenticationFilter"
class="org.jasig.cas.client.authentication.AuthenticationFilter">
<property name="casServerLoginUrl" value="https://localhost:8443/cas/login"></property>
<property name="renew" value="false"></property>
<property name="gateway" value="false"></property>
<property name="service" value="https://my.local.service.com/cas-client"></property>
</bean>

相关问题