1

Spring Security 3.0.3 と CAS を使用しています。私の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

お探しの内容が理解できれば、${cas.app.url}/login を参照していただけます。サービス パラメータは省略します。これにより、casサーバーのログインページに移動し、すべての安全なサービスに対して認証されます.

于 2010-11-19T14:33:41.507 に答える
0

パターンに一致する任意の URL を指すことができます<security:intercept-url pattern="/*/secure/**" access="ROLE_USER" />

于 2010-08-19T15:16:50.113 に答える