Spring(3.2.8) + CAS (4.0.0) を使用しており、ログアウト後に (ログアウト確認ページを表示する代わりに) ログイン ページにリダイレクトしたいと考えています。
cas.propertiesに追加しようとし
cas.logout.followServiceRedirects=true
ましたが、何も起こりません。
ユーザーがログアウトしたい場合、クライアント側で次のようにアクセスします: APP_URL/j_spring_cas_security_logout
私のlogout-webflow.xmlは次のようになります。
<flow xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/webflow"
xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<action-state id="terminateSession">
<on-entry>
<evaluate expression="cryptoServerLogoutInterceptor.terminateCryptoSession(flowRequestContext)"/>
</on-entry>
<evaluate expression="terminateSessionAction.terminate(flowRequestContext)"/>
<transition to="doLogout"/>
</action-state>
<action-state id="doLogout">
<evaluate expression="logoutAction"/>
<transition on="finish" to="finishLogout"/>
<transition on="front" to="frontLogout"/>
</action-state>
<action-state id="frontLogout">
<evaluate expression="frontChannelLogoutAction"/>
<transition on="finish" to="finishLogout"/>
<transition on="redirectApp" to="redirectToFrontApp"/>
</action-state>
<view-state id="redirectToFrontApp"
view="externalRedirect:#{currentEvent.attributes.logoutUrl}&RelayState=#{flowExecutionContext.key}">
<transition on="next" to="frontLogout"/>
</view-state>
<decision-state id="finishLogout">
<if test="flowScope.logoutRedirectUrl != null" then="redirectView" else="logoutView"/>
</decision-state>
<end-state id="redirectView" view="externalRedirect:#{flowScope.logoutRedirectUrl}"/>
<view-state id="logoutView" view="casLogoutView"/>
一方、ユーザーが認証されずにアプリにアクセスすると、次のようにリダイレクトされます: CAS_URL/login?service=APP_URL%2Fj_spring_cas_security_check
したがって、おそらくどこかに追加/保持する必要があります: service=APP_URL
助けてくれてありがとう。
編集
私がしようとすると:
<end-state id="logoutView" view="flowRedirect:login"/>
私は最終的に:
このウェブページにはリダイレクトループが含まれてい
ERR_TOO_MANY_REDIRECTS
しかし、それは以下で動作します:
<end-state id="logoutView" view="externalRedirect:contextRelative:login"/>