クラス AbstractSessionFixationProtectionStrategy

java.lang.ObjectSE
org.springframework.security.web.authentication.session.AbstractSessionFixationProtectionStrategy
実装されたすべてのインターフェース:
org.springframework.beans.factory.Awareorg.springframework.context.ApplicationEventPublisherAwareSessionAuthenticationStrategy
既知の直属サブクラス
ChangeSessionIdAuthenticationStrategySessionFixationProtectionStrategy

public abstract class AbstractSessionFixationProtectionStrategy extends ObjectSE implements SessionAuthenticationStrategy, org.springframework.context.ApplicationEventPublisherAware
セッション固定保護を実行するための基本クラス。
導入:
3.2
  • フィールドの詳細

    • logger

      protected final org.apache.commons.logging.Log logger
  • メソッドの詳細

    • onAuthentication

      public void onAuthentication(Authentication authentication, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      ユーザーが新しく認証されたときに呼び出されます。

      セッションがすでに存在し、クライアントからのセッション ID と一致する場合、新しいセッションが作成され、セッション属性がそこにコピーされます(migrateSessionAttributes が設定されている場合)。クライアントのリクエストされたセッション ID が無効な場合、現在のセッションと一致しない場合はセッション ID を変更する必要がないため、何も実行されません。

      セッションがない場合、alwaysCreateSession プロパティが設定されていない限り、アクションは実行されません。その場合、セッションが存在しない場合はセッションが作成されます。

      次で指定:
      インターフェース SessionAuthenticationStrategyonAuthentication 
    • onSessionChange

      protected void onSessionChange(StringSE originalSessionId, jakarta.servlet.http.HttpSession newSession, Authentication auth)
      セッションが変更され、古い属性が新しいセッションに移行されたときに呼び出されます。開始するセッションが存在する場合にのみ呼び出されます。サブクラスが追加の動作をプラグインできるようにします。*

      このメソッドのデフォルト実装は、セッション ID が変更されたことをアプリケーションに通知するために SessionFixationProtectionEvent を公開します。このメソッドをオーバーライドしても、これらのイベントを公開したい場合は、オーバーライドメソッド内で super.onSessionChange() を呼び出す必要があります。

      パラメーター:
      originalSessionId - 元のセッション識別子
      newSession - 新しく作成されたセッション
      auth - 新しく認証されたプリンシパルのトークン
    • setApplicationEventPublisher

      public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
      SessionFixationProtectionEvent の送信に使用する ApplicationEventPublisher を設定します。デフォルトでは、SessionFixationProtectionEvent は送信されません。
      次で指定:
      インターフェース org.springframework.context.ApplicationEventPublisherAwaresetApplicationEventPublisher 
      パラメーター:
      applicationEventPublisher - ApplicationEventPublishernull にはできません。
    • setAlwaysCreateSession

      public void setAlwaysCreateSession(boolean alwaysCreateSession)