クラス AnonymousAuthenticationProvider
java.lang.ObjectSE
org.springframework.security.authentication.AnonymousAuthenticationProvider
- 実装されているすべてのインターフェース:
org.springframework.beans.factory.Aware、org.springframework.context.MessageSourceAware、AuthenticationProvider
public class AnonymousAuthenticationProvider
extends ObjectSE
implements AuthenticationProvider, org.springframework.context.MessageSourceAware
AnonymousAuthenticationToken を検証する AuthenticationProvider 実装。 正常に検証されるには、AnonymousAuthenticationToken.getKeyHash() がこのクラスの getKey() と一致する必要があります。
フィールドのサマリー
フィールドコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明@Nullable Authenticationauthenticate(Authentication authentication) AuthenticationManager.authenticate(Authentication)と同じ契約で認証を実行します。getKey()voidsetMessageSource(org.springframework.context.MessageSource messageSource) booleanこのAuthenticationProviderが指定されたAuthenticationオブジェクトをサポートしている場合は、trueを返します。
フィールドの詳細
messages
protected org.springframework.context.support.MessageSourceAccessor messages
コンストラクターの詳細
AnonymousAuthenticationProvider
メソッドの詳細
authenticate
public @Nullable Authentication authenticate(Authentication authentication) throws AuthenticationException インターフェースからコピーされた説明:AuthenticationProviderAuthenticationManager.authenticate(Authentication)と同じ契約で認証を実行します。- 次で指定:
- インターフェース
AuthenticationProviderのauthenticate - パラメーター:
authentication- 認証リクエストオブジェクト。- 戻り値:
- 資格情報を含む完全に認証されたオブジェクト。
AuthenticationProviderが、渡されたAuthenticationオブジェクトの認証をサポートできない場合、nullを返すことがあります。そのような場合、提示されたAuthenticationクラスをサポートする次のAuthenticationProviderが試行されます。 - 例外:
AuthenticationException- 認証が失敗した場合。
getKey
setMessageSource
public void setMessageSource(org.springframework.context.MessageSource messageSource) - 次で指定:
- インターフェース
org.springframework.context.MessageSourceAwareのsetMessageSource
supports
インターフェースからコピーされた説明:AuthenticationProviderこのAuthenticationProviderが指定されたAuthenticationオブジェクトをサポートする場合、trueを返します。trueを返しても、AuthenticationProviderが提示されたAuthenticationオブジェクトを認証できることは保証されません。これは単に、より詳細な評価をサポートできることを示しているだけです。AuthenticationProviderは、AuthenticationProvider.authenticate(Authentication)メソッドからnullを返して、別のAuthenticationProviderを試す必要があることを示すことができます。認証を実行できる
AuthenticationProviderの選択は、実行時にProviderManagerによって行われます。- 次で指定:
- インターフェース
AuthenticationProviderのsupports - 戻り値:
- 実装が提示された
Authenticationクラスをより厳密に評価できる場合はtrue