クラス AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>,F extends AbstractAuthenticationProcessingFilter>
- java.lang.Object
-
- org.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
-
- org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<T,B>
-
- org.springframework.security.config.annotation.web.configurers.AbstractAuthenticationFilterConfigurer<B,T,F>
- 実装されたすべてのインターフェース:
SecurityConfigurer<DefaultSecurityFilterChain,B>
public abstract class AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>,F extends AbstractAuthenticationProcessingFilter> extends AbstractHttpConfigurer<T,B>
AbstractAuthenticationFilterConfigurer
を構成するための基本クラス。これは内部使用のみを目的としています。- 導入:
- 3.2
- 関連事項:
FormLoginConfigurer
,OpenIDLoginConfigurer
コンストラクターのサマリー
コンストラクター 修飾子 コンストラクター 説明 protected
AbstractAuthenticationFilterConfigurer()
最小のデフォルトで新しいインスタンスを作成しますprotected
AbstractAuthenticationFilterConfigurer(F authenticationFilter, java.lang.String defaultLoginProcessingUrl)
新しいインスタンスを作成します
メソッドのサマリー
すべてのメソッド インスタンスメソッド 抽象メソッド 具象メソッド 修飾子と型 メソッド 説明 T
authenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
カスタムAuthenticationDetailsSource
を指定します。void
configure(B http)
SecurityBuilder
に必要なプロパティを設定して、SecurityBuilder
を構成します。protected abstract RequestMatcher
createLoginProcessingUrlMatcher(java.lang.String loginProcessingUrl)
loginProcessingUrl を指定してRequestMatcher
を作成しますT
defaultSuccessUrl(java.lang.String defaultSuccessUrl)
ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、認証後にユーザーがリダイレクトされる場所を指定します。T
defaultSuccessUrl(java.lang.String defaultSuccessUrl, boolean alwaysUse)
ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、またはalwaysUse
が true の場合、認証後にユーザーがリダイレクトされる場所を指定します。T
failureHandler(AuthenticationFailureHandler authenticationFailureHandler)
認証が失敗したときに使用するAuthenticationFailureHandler
を指定します。T
failureUrl(java.lang.String authenticationFailureUrl)
認証が失敗した場合にユーザーを送信する URL。protected AuthenticationEntryPoint
getAuthenticationEntryPoint()
認証エントリポイントを取得しますprotected RequestMatcher
getAuthenticationEntryPointMatcher(B http)
protected F
getAuthenticationFilter()
認証フィルターを取得しますprotected java.lang.String
getFailureUrl()
認証が失敗した場合にユーザーを送信する URL を取得しますprotected java.lang.String
getLoginPage()
ログインページを取得しますprotected java.lang.String
getLoginProcessingUrl()
認証リクエストを送信する URL を取得します(つまりvoid
init(B http)
SecurityBuilder
を初期化します。boolean
isCustomLoginPage()
protected T
loginPage(java.lang.String loginPage)
ログインが必要な場合にユーザーを送信する URL を指定します。T
loginProcessingUrl(java.lang.String loginProcessingUrl)
資格情報を検証する URL を指定します。T
permitAll()
permitAll(true)の呼び出しと同等T
permitAll(boolean permitAll)
failureUrl(String)
およびHttpSecurityBuilder
、getLoginPage()
およびgetLoginProcessingUrl()
の URL がすべてのユーザーにアクセスを許可されるようにします。protected void
registerAuthenticationEntryPoint(B http, AuthenticationEntryPoint authenticationEntryPoint)
protected void
registerDefaultAuthenticationEntryPoint(B http)
protected void
setAuthenticationFilter(F authFilter)
認証フィルターを設定しますT
successHandler(AuthenticationSuccessHandler successHandler)
使用するAuthenticationSuccessHandler
を指定します。protected void
updateAccessDefaults(B http)
アクセスのデフォルト値を更新します。protected void
updateAuthenticationDefaults()
認証のデフォルト値を更新します。クラス org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer から継承されたメソッド
disable, withObjectPostProcessor
クラス org.springframework.security.config.annotation.SecurityConfigurerAdapter から継承されたメソッド
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
コンストラクターの詳細
AbstractAuthenticationFilterConfigurer
protected AbstractAuthenticationFilterConfigurer()
最小のデフォルトで新しいインスタンスを作成します
AbstractAuthenticationFilterConfigurer
protected AbstractAuthenticationFilterConfigurer(F authenticationFilter, java.lang.String defaultLoginProcessingUrl)
新しいインスタンスを作成します- パラメーター:
authenticationFilter
- 使用するAbstractAuthenticationProcessingFilter
defaultLoginProcessingUrl
-loginProcessingUrl(String)
に使用するデフォルト URL
メソッドの詳細
defaultSuccessUrl
public final T defaultSuccessUrl(java.lang.String defaultSuccessUrl)
ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、認証後にユーザーがリダイレクトされる場所を指定します。これは、defaultSuccessUrl(String, boolean)
を呼び出すためのショートカットです。- パラメーター:
defaultSuccessUrl
- デフォルトの成功 URL- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
defaultSuccessUrl
public final T defaultSuccessUrl(java.lang.String defaultSuccessUrl, boolean alwaysUse)
ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、またはalwaysUse
が true の場合、認証後にユーザーがリダイレクトされる場所を指定します。これは、successHandler(AuthenticationSuccessHandler)
を呼び出すためのショートカットです。- パラメーター:
defaultSuccessUrl
- デフォルトの成功 URLalwaysUse
- 保護されたページに以前にアクセスしたことがあるにもかかわらず、認証後にdefaultSuccesUrl
を使用する必要がある場合は true- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
loginProcessingUrl
public T loginProcessingUrl(java.lang.String loginProcessingUrl)
資格情報を検証する URL を指定します。- パラメーター:
loginProcessingUrl
- ユーザー名とパスワードを検証する URL- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
createLoginProcessingUrlMatcher
protected abstract RequestMatcher createLoginProcessingUrlMatcher(java.lang.String loginProcessingUrl)
loginProcessingUrl を指定してRequestMatcher
を作成します- パラメーター:
loginProcessingUrl
- loginProcessingUrl に基づいてRequestMatcher
を作成します- 戻り値:
- loginProcessingUrl に基づいて使用する
RequestMatcher
authenticationDetailsSource
public final T authenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
カスタムAuthenticationDetailsSource
を指定します。デフォルトはWebAuthenticationDetailsSource
です。- パラメーター:
authenticationDetailsSource
- カスタムAuthenticationDetailsSource
- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
successHandler
public final T successHandler(AuthenticationSuccessHandler successHandler)
使用するAuthenticationSuccessHandler
を指定します。デフォルトはSavedRequestAwareAuthenticationSuccessHandler
で、追加のプロパティは設定されていません。- パラメーター:
successHandler
-AuthenticationSuccessHandler
- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
permitAll
public final T permitAll()
permitAll(true)の呼び出しと同等- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
permitAll
public final T permitAll(boolean permitAll)
failureUrl(String)
およびHttpSecurityBuilder
、getLoginPage()
およびgetLoginProcessingUrl()
の URL がすべてのユーザーにアクセスを許可されるようにします。- パラメーター:
permitAll
- URL へのアクセスを許可する場合は true、この手順をスキップする場合は false- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
failureUrl
public final T failureUrl(java.lang.String authenticationFailureUrl)
認証が失敗した場合にユーザーに送信する URL。これは、failureHandler(AuthenticationFailureHandler)
を呼び出すためのショートカットです。デフォルトは "/login?error" です。- パラメーター:
authenticationFailureUrl
- 認証が失敗した場合にユーザーに送信する URL(つまり、"/login?error")。- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
failureHandler
public final T failureHandler(AuthenticationFailureHandler authenticationFailureHandler)
認証が失敗したときに使用するAuthenticationFailureHandler
を指定します。デフォルトでは、SimpleUrlAuthenticationFailureHandler
を使用して "/login?error" にリダイレクトされます- パラメーター:
authenticationFailureHandler
- 認証が失敗したときに使用するAuthenticationFailureHandler
- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
init
public void init(B http) throws java.lang.Exception
インターフェースからコピーされた説明:SecurityConfigurer
SecurityBuilder
を初期化します。ここでは、共有状態のみを作成および変更する必要がありますが、オブジェクトの構築に使用されるSecurityBuilder
のプロパティは作成および変更しないでください。これにより、構築時にSecurityConfigurer.configure(SecurityBuilder)
メソッドが正しい共有オブジェクトを使用するようになります。ここで設定を適用する必要があります。- 次で指定:
- インターフェース
SecurityConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>>
のinit
- オーバーライド:
- クラス
SecurityConfigurerAdapter<DefaultSecurityFilterChain,B extends HttpSecurityBuilder<B>>
のinit
- 例外:
java.lang.Exception
registerDefaultAuthenticationEntryPoint
protected final void registerDefaultAuthenticationEntryPoint(B http)
registerAuthenticationEntryPoint
protected final void registerAuthenticationEntryPoint(B http, AuthenticationEntryPoint authenticationEntryPoint)
getAuthenticationEntryPointMatcher
protected final RequestMatcher getAuthenticationEntryPointMatcher(B http)
configure
public void configure(B http) throws java.lang.Exception
インターフェースからコピーされた説明:SecurityConfigurer
SecurityBuilder
に必要なプロパティを設定して、SecurityBuilder
を構成します。- 次で指定:
- インターフェース
SecurityConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>>
のconfigure
- オーバーライド:
- クラス
SecurityConfigurerAdapter<DefaultSecurityFilterChain,B extends HttpSecurityBuilder<B>>
のconfigure
- 例外:
java.lang.Exception
loginPage
protected T loginPage(java.lang.String loginPage)
ログインが必要な場合にユーザーを送信する URL を指定します。
WebSecurityConfigurerAdapter
で使用すると、この属性が指定されていない場合にデフォルトのログインページが生成されます。URL が指定されている場合、またはこれが
WebSecurityConfigurerAdapter
と組み合わせて使用されていない場合、ユーザーは指定された URL を処理してログインページを生成する必要があります。
isCustomLoginPage
public final boolean isCustomLoginPage()
- 戻り値:
- カスタムログインページが指定されている場合は true、それ以外の場合は false
getAuthenticationFilter
protected final F getAuthenticationFilter()
認証フィルターを取得します- 戻り値:
- 認証フィルター
setAuthenticationFilter
protected final void setAuthenticationFilter(F authFilter)
認証フィルターを設定します- パラメーター:
authFilter
- 認証フィルター
getLoginPage
protected final java.lang.String getLoginPage()
ログインページを取得します- 戻り値:
- ログインページ
getAuthenticationEntryPoint
protected final AuthenticationEntryPoint getAuthenticationEntryPoint()
認証エントリポイントを取得します- 戻り値:
- 認証エントリポイント
getLoginProcessingUrl
protected final java.lang.String getLoginProcessingUrl()
認証リクエストを送信する URL を取得します (つまり、ユーザー名 / パスワードを送信する必要がある場所)- 戻り値:
- 認証リクエストを送信する URL
getFailureUrl
protected final java.lang.String getFailureUrl()
認証が失敗した場合にユーザーを送信する URL を取得します- 戻り値:
- 認証が失敗した場合にユーザーに送信する URL(例: "/login?error")。
updateAuthenticationDefaults
protected final void updateAuthenticationDefaults()
認証のデフォルト値を更新します。- 例外:
java.lang.Exception
updateAccessDefaults
protected final void updateAccessDefaults(B http)
アクセスのデフォルト値を更新します。