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