クラス ExceptionMappingAuthenticationFailureHandler
- java.lang.Object
-
- org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
-
- org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler
- 実装されているすべてのインターフェース:
AuthenticationFailureHandler
public class ExceptionMappingAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler
例外型の内部マップを URL に使用して、認証失敗時の宛先を判別します。キーは完全な例外クラス名です。一致が見つからない場合は、親クラス
SimpleUrlAuthenticationFailureHandlerの動作にフォールバックします。例外名と URL のマップは、exceptionMappings プロパティを設定して挿入する必要があります。
- 導入:
- 3.0
フィールドのサマリー
クラス org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler から継承されたフィールド
logger
コンストラクターの概要
コンストラクター コンストラクター 説明 ExceptionMappingAuthenticationFailureHandler()
メソッドのサマリー
すべてのメソッド インスタンスメソッド 具象メソッド 修飾子と型 メソッド 説明 voidonAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception)設定されている場合、defaultFailureUrlへのリダイレクトまたは転送を実行します。それ以外の場合は、401 エラーコードを返します。voidsetExceptionMappings(java.util.Map<?,?> failureUrlMap)例外型のマップを(名前で)URL に設定します。クラス org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler から継承されたメソッド
getRedirectStrategy, isAllowSessionCreation, isUseForward, saveException, setAllowSessionCreation, setDefaultFailureUrl, setRedirectStrategy, setUseForward
メソッドの詳細
onAuthenticationFailure
public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception) throws java.io.IOException, javax.servlet.ServletExceptionクラスからコピーされた説明:SimpleUrlAuthenticationFailureHandler設定されている場合、defaultFailureUrlへのリダイレクトまたは転送を実行します。それ以外の場合は、401 エラーコードを返します。リダイレクトまたは転送する場合、
saveExceptionが呼び出され、例外をキャッシュしてターゲットビューで使用します。- 次で指定:
- インターフェース
AuthenticationFailureHandlerのonAuthenticationFailure - オーバーライド:
- クラス
SimpleUrlAuthenticationFailureHandlerのonAuthenticationFailure - パラメーター:
request- 認証試行が発生したリクエスト。response- レスポンス。exception- 認証リクエストを拒否するためにスローされた例外。- 例外:
java.io.IOExceptionjavax.servlet.ServletException
setExceptionMappings
public void setExceptionMappings(java.util.Map<?,?> failureUrlMap)
例外型のマップを(名前で)URL に設定します。- パラメーター:
failureUrlMap- 例外クラスの完全修飾名をキーとし、対応する失敗 URL を値として持つマップ。- 例外:
java.lang.IllegalArgumentException- エントリが文字列でない場合、または URL が無効な場合。