クラス SecurityContextLogoutHandler

  • 実装されているすべてのインターフェース:
    LogoutHandler

    public class SecurityContextLogoutHandler
    extends java.lang.Object
    implements LogoutHandler
    SecurityContextHolder を変更してログアウトを実行します。

    isInvalidateHttpSession() が true であり、セッションが null でない場合も、HttpSession を無効にします。

    また、clearAuthentication が true (デフォルト) に設定されている場合、現在の SecurityContext から Authentication を削除します。

    • フィールドの詳細

      • logger

        protected final org.apache.commons.logging.Log logger
    • コンストラクターの詳細

      • SecurityContextLogoutHandler

        public SecurityContextLogoutHandler()
    • メソッドの詳細

      • logout

        public void logout​(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           Authentication authentication)
        リクエストを渡す必要があります。
        次で指定:
        インターフェース LogoutHandlerlogout 
        パラメーター:
        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。