Interface AuthenticationProvider
-
- All Known Implementing Classes:
AbstractJaasAuthenticationProvider
,AbstractLdapAuthenticationProvider
,AbstractUserDetailsAuthenticationProvider
,ActiveDirectoryLdapAuthenticationProvider
,AnonymousAuthenticationProvider
,AuthenticationManagerBeanDefinitionParser.NullAuthenticationProvider
,CasAuthenticationProvider
,DaoAuthenticationProvider
,DefaultJaasAuthenticationProvider
,JaasAuthenticationProvider
,JwtAuthenticationProvider
,LdapAuthenticationProvider
,OAuth2AuthorizationCodeAuthenticationProvider
,OAuth2LoginAuthenticationProvider
,OidcAuthorizationCodeAuthenticationProvider
,OpaqueTokenAuthenticationProvider
,OpenIDAuthenticationProvider
,OpenSamlAuthenticationProvider
,PreAuthenticatedAuthenticationProvider
,RememberMeAuthenticationProvider
,RemoteAuthenticationProvider
,RunAsImplAuthenticationProvider
,TestingAuthenticationProvider
public interface AuthenticationProvider
Indicates a class can process a specificAuthentication
implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Authentication
authenticate(Authentication authentication)
Performs authentication with the same contract asAuthenticationManager.authenticate(Authentication)
.boolean
supports(java.lang.Class<?> authentication)
Returnstrue
if thisAuthenticationProvider
supports the indicatedAuthentication
object.
-
-
-
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
null
if theAuthenticationProvider
is unable to support authentication of the passedAuthentication
object. In such a case, the nextAuthenticationProvider
that supports the presentedAuthentication
class will be tried. - Throws:
AuthenticationException
- if authentication fails.
-
supports
boolean supports(java.lang.Class<?> authentication)
Returnstrue
if thisAuthenticationProvider
supports the indicatedAuthentication
object.Returning
true
does not guarantee anAuthenticationProvider
will be able to authenticate the presented instance of theAuthentication
class. It simply indicates it can support closer evaluation of it. AnAuthenticationProvider
can still returnnull
from theauthenticate(Authentication)
method to indicate anotherAuthenticationProvider
should be tried.Selection of an
AuthenticationProvider
capable of performing authentication is conducted at runtime theProviderManager
.- Parameters:
authentication
-- Returns:
true
if the implementation can more closely evaluate theAuthentication
class presented
-
-