我有Spring安全3.0.3與CAS。我的一些CONF的如下:如何創建spring cas登錄鏈接
<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登錄。身份驗證後,我被重定向回到我試圖訪問的安全網址。
在每一頁我需要添加「登錄」鏈接,做同樣的事情。這個鏈接應該指向哪裏?我試過$ {cas.app.url}/login?service = $ {application.stack.hostname}/ctx/j_spring_cas_security_check,但這似乎不起作用。
當然的所有屬性都與相應的充分的主機名代替:)