クラス PreAuthenticatedAuthenticationProvider
java.lang.ObjectSE
org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider
- 実装されているすべてのインターフェース:
org.springframework.beans.factory.InitializingBean、org.springframework.core.Ordered、AuthenticationProvider
public class PreAuthenticatedAuthenticationProvider
extends ObjectSE
implements AuthenticationProvider, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered
事前認証された認証リクエストを処理します。通常、リクエストは AbstractPreAuthenticatedProcessingFilter サブクラスから発信されます。
この認証プロバイダーは、事前に認証されている必要があるため、認証リクエストのチェックを実行しません。ただし、AuthenticationUserDetailsService の実装では、たとえば UsernameNotFoundException が引き続きスローされる場合があります。
- 導入:
- 2.0
フィールドのサマリー
インターフェース org.springframework.core.Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明voidすべての必須プロパティが設定されているかどうかを確認します。authenticate(Authentication authentication) 指定された PreAuthenticatedAuthenticationToken を認証します。intgetOrder()voidsetOrder(int i) voidsetPreAuthenticatedUserDetailsService(AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> uds) 認証されたユーザーのUserDetailsのロードに使用される AuthenticatedUserDetailsService を設定します。voidsetThrowExceptionWhenTokenRejected(boolean throwExceptionWhenTokenRejected) true の場合、提示された認証リクエストが無効(null プリンシパルまたは資格情報を含む)の場合、プロバイダーは BadCredentialsException をスローします。voidsetUserDetailsChecker(UserDetailsChecker userDetailsChecker) ロードされた UserDetails オブジェクトをユーザーに検証するために使用される戦略を設定します。final booleanこのプロバイダーが PreAuthenticatedAuthenticationToken(サブ)クラスのみをサポートすることを示します。
コンストラクターの詳細
PreAuthenticatedAuthenticationProvider
public PreAuthenticatedAuthenticationProvider()
メソッドの詳細
afterPropertiesSet
public void afterPropertiesSet()すべての必須プロパティが設定されているかどうかを確認します。- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBeanのafterPropertiesSet
authenticate
指定された PreAuthenticatedAuthenticationToken を認証します。認証オブジェクトに含まれるプリンシパルが null の場合、リクエストは無視され、他のプロバイダーが認証できるようになります。
- 次で指定:
- インターフェース
AuthenticationProviderのauthenticate - パラメーター:
authentication- 認証リクエストオブジェクト。- 戻り値:
- 資格情報を含む完全に認証されたオブジェクト。
AuthenticationProviderが、渡されたAuthenticationオブジェクトの認証をサポートできない場合、nullを返すことがあります。そのような場合、提示されたAuthenticationクラスをサポートする次のAuthenticationProviderが試行されます。 - 例外:
AuthenticationException- 認証が失敗した場合。
supports
このプロバイダーが PreAuthenticatedAuthenticationToken(サブ)クラスのみをサポートすることを示します。- 次で指定:
- インターフェース
AuthenticationProviderのsupports - 戻り値:
- 実装が提示された
Authenticationクラスをより厳密に評価できる場合はtrue
setPreAuthenticatedUserDetailsService
public void setPreAuthenticatedUserDetailsService(AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> uds) 認証されたユーザーのUserDetailsのロードに使用される AuthenticatedUserDetailsService を設定します。- パラメーター:
uds-
setThrowExceptionWhenTokenRejected
public void setThrowExceptionWhenTokenRejected(boolean throwExceptionWhenTokenRejected) true の場合、提示された認証リクエストが無効(null プリンシパルまたは資格情報を含む)の場合、プロバイダーは BadCredentialsException をスローします。それ以外の場合は、null を返します。デフォルトは false です。setUserDetailsChecker
ユーザーのロードされた UserDetails オブジェクトを検証するために使用される戦略を設定します。デフォルトはAccountStatusUserDetailsCheckerです。- パラメーター:
userDetailsChecker-
getOrder
public int getOrder()- 次で指定:
- インターフェース
org.springframework.core.OrderedのgetOrder
setOrder
public void setOrder(int i)