クラス AbstractSessionFixationProtectionStrategy
java.lang.ObjectSE
org.springframework.security.web.authentication.session.AbstractSessionFixationProtectionStrategy
- 実装されたすべてのインターフェース:
org.springframework.beans.factory.Aware
、org.springframework.context.ApplicationEventPublisherAware
、SessionAuthenticationStrategy
public abstract class AbstractSessionFixationProtectionStrategy
extends ObjectSE
implements SessionAuthenticationStrategy, org.springframework.context.ApplicationEventPublisherAware
セッション固定保護を実行するための基本クラス。
- 導入:
- 3.2
ネストされたクラスのサマリー
ネストされたクラス修飾子と型クラス説明protected static final class
フィールドのサマリー
フィールドメソッドのサマリー
修飾子と型メソッド説明void
onAuthentication
(Authentication authentication, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) ユーザーが新しく認証されたときに呼び出されます。protected void
onSessionChange
(StringSE originalSessionId, jakarta.servlet.http.HttpSession newSession, Authentication auth) セッションが変更され、古い属性が新しいセッションに移行されたときに呼び出されます。void
setAlwaysCreateSession
(boolean alwaysCreateSession) void
setApplicationEventPublisher
(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) SessionFixationProtectionEvent
の送信に使用するApplicationEventPublisher
を設定します。
フィールドの詳細
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
プロパティが設定されていない限り、アクションは実行されません。その場合、セッションが存在しない場合はセッションが作成されます。- 次で指定:
- インターフェース
SessionAuthenticationStrategy
のonAuthentication
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.ApplicationEventPublisherAware
のsetApplicationEventPublisher
- パラメーター:
applicationEventPublisher
-ApplicationEventPublisher
null にはできません。
setAlwaysCreateSession
public void setAlwaysCreateSession(boolean alwaysCreateSession)