Class NetgrifLdapAuthenticationProvider
- java.lang.Object
-
- com.netgrif.application.engine.configuration.authentication.providers.NetgrifAuthenticationProvider
-
- com.netgrif.application.engine.configuration.authentication.providers.ldap.NetgrifLdapAuthenticationProvider
-
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
@Component @ConditionalOnExpression("${nae.ldap.enabled:false}") public class NetgrifLdapAuthenticationProvider extends NetgrifAuthenticationProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.security.ldap.authentication.LdapAuthenticator
authenticator
protected org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
authoritiesPopulator
protected boolean
hideUserNotFoundExceptions
protected NaeLdapProperties
ldapProperties
protected java.lang.String
passwordAttribute
protected org.springframework.security.crypto.password.PasswordEncoder
passwordEncoder
protected boolean
useAuthenticationRequestCredentials
protected org.springframework.security.ldap.userdetails.UserDetailsContextMapper
userDetailsContextMapper
-
Fields inherited from class com.netgrif.application.engine.configuration.authentication.providers.NetgrifAuthenticationProvider
loginAttemptService, publisher, request, userDetailsService
-
-
Constructor Summary
Constructors Constructor Description NetgrifLdapAuthenticationProvider(NaeLdapProperties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.Authentication
authenticate(org.springframework.security.core.Authentication authentication)
org.springframework.ldap.core.support.BaseLdapPathContextSource
contextSource()
protected org.springframework.security.ldap.authentication.BindAuthenticator
createBindAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource)
protected org.springframework.security.ldap.authentication.LdapAuthenticator
createLdapAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource)
protected org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator
createPasswordCompareAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource)
protected org.springframework.security.core.Authentication
createSuccessfulAuthentication(org.springframework.security.authentication.UsernamePasswordAuthenticationToken authentication, org.springframework.security.core.userdetails.UserDetails user)
protected org.springframework.security.ldap.authentication.LdapAuthenticator
getAuthenticator()
protected org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
getAuthoritiesPopulator()
protected java.util.Collection<org.springframework.security.core.GrantedAuthority>
loadUserAuthorities(org.springframework.ldap.core.DirContextOperations userData, java.lang.String username, java.lang.String password)
protected void
setAuthenticator(org.springframework.security.ldap.authentication.LdapAuthenticator authenticator)
protected void
setAuthoritiesPopulator(org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator authoritiesPopulator)
void
setUseAuthenticationRequestCredentials(boolean useAuthenticationRequestCredentials)
void
setUserDetailsContextMapper(org.springframework.security.ldap.userdetails.UserDetailsContextMapper userDetailsContextMapper)
boolean
supports(java.lang.Class<? extends java.lang.Object> authentication)
-
Methods inherited from class com.netgrif.application.engine.configuration.authentication.providers.NetgrifAuthenticationProvider
getClientIP, loadUserByUsername
-
-
-
-
Field Detail
-
ldapProperties
protected NaeLdapProperties ldapProperties
-
passwordEncoder
protected org.springframework.security.crypto.password.PasswordEncoder passwordEncoder
-
passwordAttribute
protected java.lang.String passwordAttribute
-
authenticator
protected org.springframework.security.ldap.authentication.LdapAuthenticator authenticator
-
authoritiesPopulator
protected org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator authoritiesPopulator
-
userDetailsContextMapper
protected org.springframework.security.ldap.userdetails.UserDetailsContextMapper userDetailsContextMapper
-
useAuthenticationRequestCredentials
protected boolean useAuthenticationRequestCredentials
-
hideUserNotFoundExceptions
protected boolean hideUserNotFoundExceptions
-
-
Constructor Detail
-
NetgrifLdapAuthenticationProvider
public NetgrifLdapAuthenticationProvider(NaeLdapProperties properties)
-
-
Method Detail
-
contextSource
public org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource()
-
createBindAuthenticator
protected org.springframework.security.ldap.authentication.BindAuthenticator createBindAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource)
-
createPasswordCompareAuthenticator
protected org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator createPasswordCompareAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource)
-
createLdapAuthenticator
protected org.springframework.security.ldap.authentication.LdapAuthenticator createLdapAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource)
-
setAuthenticator
protected void setAuthenticator(org.springframework.security.ldap.authentication.LdapAuthenticator authenticator)
-
getAuthenticator
protected org.springframework.security.ldap.authentication.LdapAuthenticator getAuthenticator()
-
setAuthoritiesPopulator
protected void setAuthoritiesPopulator(org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator authoritiesPopulator)
-
getAuthoritiesPopulator
protected org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator getAuthoritiesPopulator()
-
setUserDetailsContextMapper
public void setUserDetailsContextMapper(org.springframework.security.ldap.userdetails.UserDetailsContextMapper userDetailsContextMapper)
-
setUseAuthenticationRequestCredentials
public void setUseAuthenticationRequestCredentials(boolean useAuthenticationRequestCredentials)
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
- Specified by:
authenticate
in interfaceorg.springframework.security.authentication.AuthenticationProvider
- Specified by:
authenticate
in classNetgrifAuthenticationProvider
- Throws:
org.springframework.security.core.AuthenticationException
-
loadUserAuthorities
protected java.util.Collection<org.springframework.security.core.GrantedAuthority> loadUserAuthorities(org.springframework.ldap.core.DirContextOperations userData, java.lang.String username, java.lang.String password)
-
createSuccessfulAuthentication
protected org.springframework.security.core.Authentication createSuccessfulAuthentication(org.springframework.security.authentication.UsernamePasswordAuthenticationToken authentication, org.springframework.security.core.userdetails.UserDetails user)
-
supports
public boolean supports(java.lang.Class<? extends java.lang.Object> authentication)
- Specified by:
supports
in interfaceorg.springframework.security.authentication.AuthenticationProvider
- Specified by:
supports
in classNetgrifAuthenticationProvider
-
-