クラス HttpMessageConverterAuthenticationSuccessHandler
java.lang.ObjectSE
org.springframework.security.web.authentication.HttpMessageConverterAuthenticationSuccessHandler
- 実装されているすべてのインターフェース:
AuthenticationSuccessHandler
public final class HttpMessageConverterAuthenticationSuccessHandler
extends ObjectSE
implements AuthenticationSuccessHandler
リダイレクト URL と認証ステータスを含む JSON レスポンスを書き込む
AuthenticationSuccessHandler: { "redirectUrl": "/user/profile", "authenticated": true } - 導入:
- 6.4
ネストされたクラスの要約
ネストされたクラス修飾子と型クラス説明static final class認証成功時の JSON レスポンスを書き込むために使用されるレスポンスオブジェクト。コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明voidonAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) ユーザーが正常に認証されたときに呼び出されます。voidsetConverter(org.springframework.http.converter.HttpMessageConverter<ObjectSE> converter) レスポンスに書き込むためにGenericHttpMessageConverterを設定します。voidsetRequestCache(RequestCache requestCache) 使用するRequestCacheを設定します。クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.security.web.authentication.AuthenticationSuccessHandler から継承されたメソッド
onAuthenticationSuccess
コンストラクターの詳細
HttpMessageConverterAuthenticationSuccessHandler
public HttpMessageConverterAuthenticationSuccessHandler()
メソッドの詳細
setConverter
public void setConverter(org.springframework.http.converter.HttpMessageConverter<ObjectSE> converter) レスポンスに書き込むGenericHttpMessageConverterを設定します。デフォルトはMappingJackson2HttpMessageConverterです。- パラメーター:
converter- 使用するGenericHttpMessageConverter。null にはできません。
setRequestCache
使用するRequestCacheを設定します。デフォルトはHttpSessionRequestCacheです。- パラメーター:
requestCache- 使用するRequestCache。null にはできません
onAuthenticationSuccess
public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) throws IOExceptionSE, jakarta.servlet.ServletException インターフェースからコピーされた説明:AuthenticationSuccessHandlerユーザーが正常に認証されたときに呼び出されます。- 次で指定:
- インターフェース
AuthenticationSuccessHandlerのonAuthenticationSuccess - パラメーター:
request- 成功した認証を引き起こしたリクエストresponse- レスポンスauthentication- 認証プロセス中に作成された Authentication オブジェクト。- 例外:
IOExceptionSEjakarta.servlet.ServletException