My JXplorer didt'n show the full tree.
Options -> Advanced Options -> Search Limits -> Set 'LDAP Limit' to : 10.000
Fixed it
When open remember to rigth click and select 'Refresh' on eg. World/dk/zeed to see full tree
JXplorer
1 comments Filed Under: AD, JXplorer, LDAP
validate against AD with Spring
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.ProviderManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider;
import java.util.Collections;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsContextMapperImpl userDetailsContextMapper;
@Value("${ldap.disable:false}")
private String disable;
@Value("${ldap.domain}")
private String domain;
@Value("${ldap.url}")
private String url;
@Override
protected void configure(final HttpSecurity http) throws Exception {
if (!"true".equals(disable)) {
http
.formLogin()
.permitAll()
.and()
.authorizeRequests()
.antMatchers("/ErrorViewer/*")
.authenticated()
.and().csrf().disable();
} else {
http.csrf().disable();
}
}
@Override
protected void configure(final AuthenticationManagerBuilder authManagerBuilder) throws Exception {
authManagerBuilder.authenticationProvider(activeDirectoryLdapAuthenticationProvider()).userDetailsService(userDetailsService());
}
@Bean
public AuthenticationManager authenticationManager() {
return new ProviderManager(Collections.singletonList(activeDirectoryLdapAuthenticationProvider()));
}
@Bean
public AuthenticationProvider activeDirectoryLdapAuthenticationProvider() {
final ActiveDirectoryLdapAuthenticationProvider provider = new ActiveDirectoryLdapAuthenticationProvider(domain, url);
provider.setConvertSubErrorCodesToExceptions(true);
provider.setUseAuthenticationRequestCredentials(true);
provider.setUserDetailsContextMapper(userDetailsContextMapper);
return provider;
}
}
0 comments Filed Under: AD, LDAP, Spring