Interface AuthenticationProvider
-
- All Known Implementing Classes:
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 AuthenticationProviderIndicates a class can process a specificAuthenticationimplementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Authenticationauthenticate(Authentication authentication)Performs authentication with the same contract asAuthenticationManager.authenticate(Authentication).booleansupports(java.lang.Class<?> authentication)Returnstrueif thisAuthenticationProvidersupports the indicatedAuthenticationobject.
-
-
-
Method Detail
-
authenticate
Authentication authenticate(Authentication authentication) throws AuthenticationException
Performs authentication with the same contract asAuthenticationManager.authenticate(Authentication).- Parameters:
authentication- the authentication request object.- Returns:
- a fully authenticated object including credentials. May return
nullif theAuthenticationProvideris unable to support authentication of the passedAuthenticationobject. In such a case, the nextAuthenticationProviderthat supports the presentedAuthenticationclass will be tried. - Throws:
AuthenticationException- if authentication fails.
-
supports
boolean supports(java.lang.Class<?> authentication)
Returnstrueif thisAuthenticationProvidersupports the indicatedAuthenticationobject.Returning
truedoes not guarantee anAuthenticationProviderwill be able to authenticate the presented instance of theAuthenticationclass. It simply indicates it can support closer evaluation of it. AnAuthenticationProvidercan still returnnullfrom theauthenticate(Authentication)method to indicate anotherAuthenticationProvidershould be tried.Selection of an
AuthenticationProvidercapable of performing authentication is conducted at runtime theProviderManager.- Parameters:
authentication-- Returns:
trueif the implementation can more closely evaluate theAuthenticationclass presented
-
-