クラス SessionManagementConfigurer.ConcurrencyControlConfigurer
java.lang.ObjectSE
org.springframework.security.config.annotation.web.configurers.SessionManagementConfigurer.ConcurrencyControlConfigurer
- 含まれているクラス:
- SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
複数のセッションの制御を構成できます。
メソッドのサマリー
修飾子と型メソッド説明and()
非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。7.0 の取り外し用。expiredSessionStrategy
(SessionInformationExpiredStrategy expiredSessionStrategy) 期限切れのセッションが検出されたときの動作を決定します。expiredUrl
(StringSE expiredUrl) ユーザーがリソースにアクセスしようとして、現在のユーザーのセッションが多すぎるためにセッションが期限切れになった場合にリダイレクトする URL。maximumSessions
(int maximumSessions) ユーザーのセッションの最大数を制御します。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
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
and
非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。7.0 の取り外し用。代わりにSessionManagementConfigurer.sessionConcurrency(Customizer)
を使用してくださいチェーンからSessionManagementConfigurer
に戻るために使用- 戻り値:
- さらにカスタマイズするための
SessionManagementConfigurer