インターフェース AuthenticationProvider
- すべての既知の実装クラス:
AbstractJaasAuthenticationProvider、AbstractLdapAuthenticationProvider、AbstractUserDetailsAuthenticationProvider、ActiveDirectoryLdapAuthenticationProvider、AnonymousAuthenticationProvider、AuthenticationManagerBeanDefinitionParser.NullAuthenticationProvider、CasAuthenticationProvider、DaoAuthenticationProvider、DefaultJaasAuthenticationProvider、JaasAuthenticationProvider、JwtAuthenticationProvider、LdapAuthenticationProvider、OAuth2AuthorizationCodeAuthenticationProvider、OAuth2LoginAuthenticationProvider、OidcAuthorizationCodeAuthenticationProvider、OpaqueTokenAuthenticationProvider、OpenIDAuthenticationProvider、PreAuthenticatedAuthenticationProvider、RememberMeAuthenticationProvider、RemoteAuthenticationProvider、RunAsImplAuthenticationProvider、TestingAuthenticationProvider
public interface AuthenticationProviderクラスが特定のAuthentication実装を処理できることを示します。
メソッドのサマリー
すべてのメソッド インスタンスメソッド 抽象メソッド 修飾子と型 メソッド 説明 Authenticationauthenticate(Authentication authentication)AuthenticationManager.authenticate(Authentication)と同じ契約で認証を実行します。booleansupports(java.lang.Class<?> authentication)このAuthenticationProviderが指定されたAuthenticationオブジェクトをサポートする場合、trueを返します。
メソッドの詳細
authenticate
Authentication authenticate(Authentication authentication) throws AuthenticationException
AuthenticationManager.authenticate(Authentication)と同じ契約で認証を実行します。- パラメーター:
authentication- 認証リクエストオブジェクト。- 戻り値:
- 資格情報を含む完全に認証されたオブジェクト。
AuthenticationProviderが、渡されたAuthenticationオブジェクトの認証をサポートできない場合、nullを返すことがあります。そのような場合、提示されたAuthenticationクラスをサポートする次のAuthenticationProviderが試行されます。 - 例外:
AuthenticationException- 認証が失敗した場合。
supports
boolean supports(java.lang.Class<?> authentication)
このAuthenticationProviderが指定されたAuthenticationオブジェクトをサポートする場合、trueを返します。trueを返すことは、AuthenticationProviderがAuthenticationクラスの提示されたインスタンスを認証できることを保証しません。それは、それがより詳細な評価をサポートできることを示しています。AuthenticationProviderは、authenticate(Authentication)メソッドからnullを返して、別のAuthenticationProviderを試す必要があることを示すことができます。認証を実行できる
AuthenticationProviderの選択は、実行時にProviderManagerで行われます。- パラメーター:
authentication-- 戻り値:
- 実装が提示された
Authenticationクラスをより厳密に評価できる場合はtrue