クラス SecurityContextLogoutHandler
- java.lang.Object
-
- org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler
- 実装されているすべてのインターフェース:
LogoutHandler
public class SecurityContextLogoutHandler extends java.lang.Object implements LogoutHandler
SecurityContextHolderを変更してログアウトを実行します。isInvalidateHttpSession()がtrueであり、セッションがnullでない場合も、HttpSessionを無効にします。また、
clearAuthenticationが true(デフォルト)に設定されている場合、現在のSecurityContextからAuthenticationが削除されます。
フィールドのサマリー
フィールド 修飾子と型 フィールド 説明 protected org.apache.commons.logging.Loglogger
コンストラクターの概要
コンストラクター コンストラクター 説明 SecurityContextLogoutHandler()
方法の概要
すべてのメソッド インスタンスメソッド 具象メソッド 修飾子と型 メソッド 説明 booleanisInvalidateHttpSession()voidlogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)リクエストを渡す必要があります。voidsetClearAuthentication(boolean clearAuthentication)true の場合、同時リクエストの課題を防ぐためにSecurityContextからAuthenticationを削除します。voidsetInvalidateHttpSession(boolean invalidateHttpSession)このLogoutHandlerが呼び出されると、HttpSessionが無効になります。
メソッドの詳細
logout
public void logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)リクエストを渡す必要があります。- 次で指定:
- インターフェース
LogoutHandlerのlogout - パラメーター:
request- HTTP セッションを取得する場所 (null にできません)response- 未使用 (nullにすることができます)authentication- 未使用 (nullにすることができます)
isInvalidateHttpSession
public boolean isInvalidateHttpSession()
setInvalidateHttpSession
public void setInvalidateHttpSession(boolean invalidateHttpSession)
このLogoutHandlerが呼び出されると、HttpSessionが無効になります。デフォルトは true です。- パラメーター:
invalidateHttpSession- セッションを無効にする場合は true(デフォルト)、無効にしない場合は false。
setClearAuthentication
public void setClearAuthentication(boolean clearAuthentication)
true の場合、同時リクエストの課題を防ぐためにSecurityContextからAuthenticationを削除します。- パラメーター:
clearAuthentication-SecurityContextからAuthenticationをクリアする場合は true(デフォルト)、Authenticationを削除しない場合は false。