无状态 CAS - 提供的代理回调 url j_spring_cas_security_proxyreceptor' 无法通过身份验证
Stateless CAS - The supplied proxy callback url j_spring_cas_security_proxyreceptor' could not be authenticated
我需要使用 CAS 保护我的 RESTful 无状态网络服务,现在我正在尝试按照此 Spring Stateless CAS 演示进行操作,但不断收到以下错误:
22:42:27.885 [http-nio-8443-exec-8] [first-spring-stateless] DEBUG o.s.s.c.web.CasAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.BadCredentialsException:
The supplied proxy callback url 'https://localhost:8443/first-spring-stateless/j_spring_cas_security_proxyreceptor' could not be authenticated.
访问时 https://localhost:8443/first-spring-cas/testProxy.do
url
例如我的 appointmentServiceUrl
- https://localhost:8443/first-spring-stateless/appointment.jsp?ticket=PT-110-a2a6eOE3lwImcwGpZ2Jp-cas.example.com
这可能是什么原因?
通过添加
解决
<property name="proxyReceptorUrl" value="/j_spring_cas_security_proxyreceptor"/>
到casFilter
这是 casFilter
在 applicationContext-security.xml
:
<bean id="casFilter"
class="org.springframework.security.cas.web.CasAuthenticationFilter">
<property name="authenticationManager" ref="authenticationManager"/>
<property name="proxyGrantingTicketStorage" ref="pgtStorage"/>
<property name="serviceProperties" ref="serviceProperties"/>
<property name="proxyReceptorUrl" value="/j_spring_cas_security_proxyreceptor"/>
<property name="authenticationDetailsSource">
<bean class="org.springframework.security.cas.web.authentication.ServiceAuthenticationDetailsSource"/>
</property>
</bean>
我需要使用 CAS 保护我的 RESTful 无状态网络服务,现在我正在尝试按照此 Spring Stateless CAS 演示进行操作,但不断收到以下错误:
22:42:27.885 [http-nio-8443-exec-8] [first-spring-stateless] DEBUG o.s.s.c.web.CasAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.BadCredentialsException:
The supplied proxy callback url 'https://localhost:8443/first-spring-stateless/j_spring_cas_security_proxyreceptor' could not be authenticated.
访问时 https://localhost:8443/first-spring-cas/testProxy.do
url
例如我的 appointmentServiceUrl
- https://localhost:8443/first-spring-stateless/appointment.jsp?ticket=PT-110-a2a6eOE3lwImcwGpZ2Jp-cas.example.com
这可能是什么原因?
通过添加
解决<property name="proxyReceptorUrl" value="/j_spring_cas_security_proxyreceptor"/>
到casFilter
这是 casFilter
在 applicationContext-security.xml
:
<bean id="casFilter"
class="org.springframework.security.cas.web.CasAuthenticationFilter">
<property name="authenticationManager" ref="authenticationManager"/>
<property name="proxyGrantingTicketStorage" ref="pgtStorage"/>
<property name="serviceProperties" ref="serviceProperties"/>
<property name="proxyReceptorUrl" value="/j_spring_cas_security_proxyreceptor"/>
<property name="authenticationDetailsSource">
<bean class="org.springframework.security.cas.web.authentication.ServiceAuthenticationDetailsSource"/>
</property>
</bean>