Class LdaptiveAuthenticationManager
java.lang.Object
org.bremersee.spring.security.ldaptive.authentication.LdaptiveAuthenticationManager
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.MessageSourceAware,org.springframework.security.authentication.AuthenticationManager,org.springframework.security.authentication.AuthenticationProvider
public class LdaptiveAuthenticationManager
extends Object
implements org.springframework.security.authentication.AuthenticationManager, org.springframework.security.authentication.AuthenticationProvider, org.springframework.context.MessageSourceAware
The ldaptive authentication manager.
- Author:
- Christian Bremer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.logging.LogThe Logger. -
Constructor Summary
ConstructorsConstructorDescriptionLdaptiveAuthenticationManager(LdaptiveTemplate applicationLdaptiveTemplate, LdaptiveAuthenticationProperties authenticationProperties, String rememberMeKey) Instantiates a new ldaptive authentication manager.LdaptiveAuthenticationManager(org.ldaptive.ConnectionConfig connectionConfig, LdaptiveAuthenticationProperties authenticationProperties, String rememberMeKey) Instantiates a new ldaptive authentication manager.LdaptiveAuthenticationManager(org.ldaptive.ConnectionFactory connectionFactory, LdaptiveAuthenticationProperties authenticationProperties, String rememberMeKey) Instantiates a new ldaptive authentication manager. -
Method Summary
Modifier and TypeMethodDescription@NonNull org.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) protected voidCheck account control.protected voidcheckPassword(LdaptiveUserDetails user, String password) Check password.protected voidcheckPasswordWithCompareRequest(LdaptiveUserDetails user, String password) Check password with compare request.protected voidcheckPasswordWithSimpleBind(LdaptiveUserDetails user, String password) Check password with simple bind.protected StringgetName(org.springframework.security.core.Authentication authentication) Gets name.Gets user details service.voidinit()Init.protected booleanisRefusedUsername(String username) Determines whether the username is refused by configuration.protected booleanDetermines whether to bind with username and password or to compare the passwords.protected booleanrememberMeKeyMatches(org.springframework.security.authentication.RememberMeAuthenticationToken authentication) Remember me key matches given authentication.voidsetAccountControlEvaluator(AccountControlEvaluator accountControlEvaluator) Sets account control evaluator.voidsetEmailToUsernameResolver(EmailToUsernameResolver emailToUsernameResolver) Sets email to username resolver.voidsetMessageSource(@NonNull org.springframework.context.MessageSource messageSource) boolean
-
Field Details
-
logger
protected final org.apache.commons.logging.Log loggerThe Logger.
-
-
Constructor Details
-
LdaptiveAuthenticationManager
public LdaptiveAuthenticationManager(org.ldaptive.ConnectionConfig connectionConfig, LdaptiveAuthenticationProperties authenticationProperties, String rememberMeKey) Instantiates a new ldaptive authentication manager.- Parameters:
connectionConfig- the connection configauthenticationProperties- the authentication propertiesrememberMeKey- the remember me key
-
LdaptiveAuthenticationManager
public LdaptiveAuthenticationManager(org.ldaptive.ConnectionFactory connectionFactory, LdaptiveAuthenticationProperties authenticationProperties, String rememberMeKey) Instantiates a new ldaptive authentication manager.- Parameters:
connectionFactory- the connection factoryauthenticationProperties- the authentication propertiesrememberMeKey- the remember me key
-
LdaptiveAuthenticationManager
public LdaptiveAuthenticationManager(LdaptiveTemplate applicationLdaptiveTemplate, LdaptiveAuthenticationProperties authenticationProperties, String rememberMeKey) Instantiates a new ldaptive authentication manager.- Parameters:
applicationLdaptiveTemplate- the application ldaptive templateauthenticationProperties- the authentication propertiesrememberMeKey- the remember me key
-
-
Method Details
-
setEmailToUsernameResolver
Sets email to username resolver.- Parameters:
emailToUsernameResolver- the email to username resolver
-
setAccountControlEvaluator
Sets account control evaluator.- Parameters:
accountControlEvaluator- the account control evaluator
-
setMessageSource
public void setMessageSource(@NonNull org.springframework.context.MessageSource messageSource) - Specified by:
setMessageSourcein interfaceorg.springframework.context.MessageSourceAware
-
init
public void init()Init. -
supports
- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-
rememberMeKeyMatches
protected boolean rememberMeKeyMatches(org.springframework.security.authentication.RememberMeAuthenticationToken authentication) Remember me key matches given authentication.- Parameters:
authentication- the authentication- Returns:
- the boolean
-
authenticate
public @NonNull org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException - Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationManager- Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
isRefusedUsername
Determines whether the username is refused by configuration.- Parameters:
username- the username- Returns:
trueif the username is refused, otherwisefalse
-
getName
Gets name.- Parameters:
authentication- the authentication- Returns:
- the name
-
getUserDetailsService
Gets user details service.- Returns:
- the user details service
-
isSimpleBindAuthentication
protected boolean isSimpleBindAuthentication()Determines whether to bind with username and password or to compare the passwords.- Returns:
- the boolean
-
checkPassword
Check password.- Parameters:
user- the userpassword- the password
-
checkPasswordWithCompareRequest
Check password with compare request.- Parameters:
user- the userpassword- the password
-
checkPasswordWithSimpleBind
Check password with simple bind.- Parameters:
user- the userpassword- the password
-
checkAccountControl
Check account control.- Parameters:
user- the user
-