クラス 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 レスポンスを書き込むために使用されるレスポンスオブジェクト。コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明void
onAuthenticationSuccess
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) ユーザーが正常に認証されたときに呼び出されます。void
setConverter
(org.springframework.http.converter.HttpMessageConverter<ObjectSE> converter) レスポンスに書き込むためにGenericHttpMessageConverter
を設定します。void
setRequestCache
(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 オブジェクト。- 例外:
IOExceptionSE
jakarta.servlet.ServletException