1

我有带有 CAS 的 Spring Security 3.0.3。我的一些conf如下:

<security:http entry-point-ref="casAuthenticationEntryPoint" auto-config="true" >
    <security:intercept-url pattern="/*/secure/**" access="ROLE_USER" />
    <security:custom-filter position="CAS_FILTER" ref="casAuthenticationFilter" />
    <security:anonymous enabled="false"/>
    <security:logout invalidate-session="true" logout-url="/logout" logout-success-url="/web/auth?logout" />
</security:http>

<bean id="casAuthenticationEntryPoint" class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
    <property name="loginUrl" value="${cas.app.url}/login"></property>
    <property name="serviceProperties" ref="serviceProperties"></property>
</bean>

<bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties">
    <property name="service" value="${application.stack.hostname}/ctx/j_spring_cas_security_check" />
    <property name="sendRenew" value="false" />
</bean>

如果我访问一些受保护的内容,我会被重定向到 CAS 登录。身份验证后,我被重定向回我尝试访问的安全 url。

在每个页面上,我都需要添加执行相同操作的“登录”链接。这个链接应该指向哪里?我试过 ${cas.app.url}/login?service=${application.stack.hostname}/ctx/j_spring_cas_security_check 但这似乎不起作用。

当然,所有属性都替换为适当的完整主机名:)

4

2 回答 2

0

它可以指向任何匹配模式的 URL<security:intercept-url pattern="/*/secure/**" access="ROLE_USER" />

于 2010-08-19T15:16:50.113 回答
0

如果我了解您在寻找什么,您应该能够将它们指向 ${cas.app.url}/login。省略服务参数。这会将他们带到您的 CAS 服务器的登录页面,该页面将对您的所有安全服务进行身份验证。

于 2010-11-19T14:33:41.507 回答