public class InternalUserDirectoryAuthenticationProvider extends AbstractUserInDirectoryAuthenticationProvider
InternalUserDirectory.LOG, messages, userDirectory| Constructor and Description |
|---|
InternalUserDirectoryAuthenticationProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails userDetails,
org.springframework.security.authentication.UsernamePasswordAuthenticationToken authentication)
Allows subclasses to perform any additional checks of a returned (or cached)
UserDetails
for a given authentication request. |
protected org.springframework.security.core.userdetails.UserDetails |
buildUserDetails(User user,
org.springframework.security.authentication.UsernamePasswordAuthenticationToken authentication)
Allows subclasses to build the
UserDetails for a given User. |
protected void |
doAfterPropertiesSet() |
protected org.springframework.security.crypto.password.PasswordEncoder |
getPasswordEncoder() |
void |
setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
Sets the PasswordEncoder instance to be used to encode and validate passwords.
|
afterPropertiesSet, authenticate, createSuccessAuthentication, retrieveUser, setAuthoritiesMapper, setForcePrincipalAsString, setMessageSource, setPostAuthenticationChecks, setPreAuthenticationChecks, setThrowExceptionIfUserNotFound, setUserCache, setUserDirectory, setUserService, supportspublic InternalUserDirectoryAuthenticationProvider()
protected void doAfterPropertiesSet()
throws Exception
doAfterPropertiesSet in class AbstractUserInDirectoryAuthenticationProviderExceptionprotected org.springframework.security.core.userdetails.UserDetails buildUserDetails(User user, org.springframework.security.authentication.UsernamePasswordAuthenticationToken authentication) throws org.springframework.security.core.AuthenticationException
AbstractUserInDirectoryAuthenticationProviderUserDetails for a given User.
Actual credential validation can be performed and an AuthenticationException thrown if
validation fails. In case the method returns null this will end in a null
Authentication being returned by this provider.
Note that User already implements UserDetails. If validation is successful, that same
user instance can be returned by the method implementation.buildUserDetails in class AbstractUserInDirectoryAuthenticationProvideruser - The user found with the username from the authenticationauthentication - The authentication request, which subclasses may need to perform a binding-based
retrieval of the UserDetailsnull to fall back to being "unable to authenticate"org.springframework.security.core.AuthenticationException - if the credentials could not be validatedprotected void additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails userDetails,
org.springframework.security.authentication.UsernamePasswordAuthenticationToken authentication)
throws org.springframework.security.core.AuthenticationException
AbstractUserInDirectoryAuthenticationProviderUserDetails
for a given authentication request. Generally a subclass will at least compare the Authentication.getCredentials() with a UserDetails.getPassword(). If custom logic is needed to compare
additional properties of UserDetails and/or UsernamePasswordAuthenticationToken,
these should also appear in this method.additionalAuthenticationChecks in class AbstractUserInDirectoryAuthenticationProvideruserDetails - as retrieved from the AbstractUserInDirectoryAuthenticationProvider.buildUserDetails(User, UsernamePasswordAuthenticationToken) or
UserCacheauthentication - the current request that needs to be authenticatedorg.springframework.security.core.AuthenticationException - AuthenticationException if the credentials could not be validated (generally a
BadCredentialsException, an AuthenticationServiceException)protected org.springframework.security.crypto.password.PasswordEncoder getPasswordEncoder()
public void setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
PasswordEncoderFactories.createDelegatingPasswordEncoder()passwordEncoder - must be an instance of one of the PasswordEncoder
types.Copyright © 2020. All rights reserved.