クラス SessionManagementConfigurer.ConcurrencyControlConfigurer
java.lang.ObjectSE
org.springframework.security.config.annotation.web.configurers.SessionManagementConfigurer.ConcurrencyControlConfigurer
- 含まれているクラス:
SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
複数のセッションの制御を構成できます。
- 導入:
- 3.2
方法の概要
修飾子と型メソッド説明expiredSessionStrategy(SessionInformationExpiredStrategy expiredSessionStrategy) 期限切れのセッションが検出されたときの動作を決定します。expiredUrl(StringSE expiredUrl) ユーザーがリソースにアクセスしようとして、現在のユーザーのセッションが多すぎるためにセッションが期限切れになった場合にリダイレクトする URL。maximumSessions(int maximumSessions) ユーザーのセッションの最大数を制御します。maximumSessions(SessionLimit sessionLimit) セッション制限が検出されたときの動作を決定します。maxSessionsPreventsLogin(boolean maxSessionsPreventsLogin) true の場合、maximumSessions(int)に到達したときにユーザーが認証できなくなります。sessionRegistry(SessionRegistry sessionRegistry) 使用されるSessionRegistry実装を制御します。
方法の詳細
maximumSessions
public SessionManagementConfigurer<H>.ConcurrencyControlConfigurer maximumSessions(int maximumSessions) ユーザーのセッションの最大数を制御します。デフォルトでは、任意の数のユーザーを許可します。- パラメーター:
maximumSessions- ユーザーの最大セッション数- 戻り値:
- さらなるカスタマイズのための
SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>.ConcurrencyControlConfigurer
maximumSessions
public SessionManagementConfigurer<H>.ConcurrencyControlConfigurer maximumSessions(SessionLimit sessionLimit) セッション制限が検出されたときの動作を決定します。- パラメーター:
sessionLimit-SessionLimitを使用してユーザーの最大セッション数をチェックする- 戻り値:
- さらなるカスタマイズのための
SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>.ConcurrencyControlConfigurer - 導入:
- 6.5
expiredUrl
ユーザーがリソースにアクセスしようとして、現在のユーザーのセッションが多すぎるためにセッションが期限切れになった場合にリダイレクトする URL。デフォルトでは、単純なエラーメッセージをレスポンスに書き込みます。- パラメーター:
expiredUrl- リダイレクト先の URL- 戻り値:
- さらなるカスタマイズのための
SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>.ConcurrencyControlConfigurer
expiredSessionStrategy
public SessionManagementConfigurer<H>.ConcurrencyControlConfigurer expiredSessionStrategy(SessionInformationExpiredStrategy expiredSessionStrategy) 期限切れのセッションが検出されたときの動作を決定します。- パラメーター:
expiredSessionStrategy- 期限切れのセッションが検出されたときに使用するSessionInformationExpiredStrategy。- 戻り値:
- さらなるカスタマイズのための
SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>.ConcurrencyControlConfigurer
maxSessionsPreventsLogin
public SessionManagementConfigurer<H>.ConcurrencyControlConfigurer maxSessionsPreventsLogin(boolean maxSessionsPreventsLogin) true の場合、maximumSessions(int)に到達したときにユーザーが認証できなくなります。それ以外の場合(デフォルト)、認証するユーザーはアクセスを許可され、既存のユーザーのセッションは期限切れになります。ユーザーのセッションが強制的に期限切れになると、expiredUrl(String)に送信されます。この方法の利点は、ユーザーが誤ってログアウトしない場合、管理者が介入したり、セッションの有効期限が切れるまで待つ必要がないことです。- パラメーター:
maxSessionsPreventsLogin- 認証時にエラーがある場合は true、そうでない場合は false (default)- 戻り値:
- さらなるカスタマイズのための
SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>.ConcurrencyControlConfigurer
sessionRegistry
public SessionManagementConfigurer<H>.ConcurrencyControlConfigurer sessionRegistry(SessionRegistry sessionRegistry) 使用されるSessionRegistry実装を制御します。デフォルトはSessionRegistryImplで、これはメモリ内実装です。- パラメーター:
sessionRegistry- 使用するSessionRegistry- 戻り値:
- さらなるカスタマイズのための
SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>.ConcurrencyControlConfigurer