spring-ldap

LDAP: error code 49 - Simple Bind Failed: NT_STATUS_LOGON_FAILURE

社会主义新天地 提交于 2019-12-05 19:52:36
I am trying to authenticate the user but it throws Exception .May be there is problem in configuration. public class LdapApplication { private static final String INITIAL_CONTEXT_FACTORY = "com.sun.jndi.ldap.LdapCtxFactory"; private static final String SECURITY_AUTHENTICATION ="simple"; private static final String NAMED_CONTEXT = "CN=Users"; private static final String SAM_ACCOUNT_NAME = "sAMAccountName="; public static void main(String[] args) { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,INITIAL_CONTEXT_FACTORY); env.put(Context.PROVIDER_URL, "ldap://ip:portNo/dc

Spring's LdapTemplate search: PartialResultException: Unprocessed Continuation Reference(s); remaining name '/'

落爺英雄遲暮 提交于 2019-12-04 10:39:58
I add users through LDAP for a certain application, made with spring. While this works for most of the cases, in some cases, it does not work... The retrieve the users I use: public class LdapUserServiceImpl implements ILdapUserService { @Override public List<LdapUserVO> getUserNamesByQuery(String query) { return ldapTemplate.search( query().countLimit(15) .where("objectClass").is("user") .and("sAMAccountName").isPresent() .and(query() .where("sAMAccountName").like("*" + query + "*") .or("sAMAccountName").is(query) .or("displayName").like("*" + query + "*") .or("displayName").is(query)) , new

LDAP authentication without managerDN and manager password

非 Y 不嫁゛ 提交于 2019-12-04 05:05:27
问题 I am writing an application in Java Spring framework to perform Active Directory LDAP authentication. I am succeeding in connecting to my organization LDAP. Here is the configuration settings:Spring-security.xml <!-- This is where we configure Spring-Security --> <security:http auto-config="true" use-expressions="true" access-denied-page="/oops"> <security:intercept-url pattern="/auth/*" access="isAuthenticated()" /> <security:logout invalidate-session="true" logout-success-url="/" logout-url

spring ldap 2.0.1 replacing deprecated OdmManager

帅比萌擦擦* 提交于 2019-12-04 04:43:44
问题 It seems in Spring LDAP 2.x, that the OdmManager facility is deprecated, as most odm-like things can be done by ldapTemplate, which is true. But the OdmManager has the ability to inject a ConverterManager which can be told about your custom type conversions. What is the equivalent method for using ldapTemplate for odm-like (ConverterManager) operations ? If there is not an equivalent system in ldapTemplate, should it : implicitly detect custom classes with single string constructors and

Spring LDAP - bind for successful connection

房东的猫 提交于 2019-12-04 04:42:05
I'm trying to authenticate and then query our corporate LDAP using Spring LDAP and Spring security. I managed to make authentication work but when I attempt to run search I always get the following exception In order to perform this operation a successful bind must be completed on the connection After much research I have a theory that after I authenticate and before I can query I need to bind to connection. I just don't know what and how? Just to mention - I can successfully browse and search our LDAP using JXplorer so my parameters are correct. Here's section of my securityContext.xml

Spring embedded ldap server in unit tests

浪子不回头ぞ 提交于 2019-12-04 03:54:35
I am currently trying to use an embedded ldap server for unit tests. In Spring Security, you can quickly define an embedded ldap server for testing with the tag with some sample data loaded from the specified ldif. I will be using Spring Ldap to perform ldap operations, and thinking of testing the usual CRUD features of my User service object. Is there, however, a way to ensure that the entries in the embedded server to be in the same consistent state (sort of like a delete all and reload the ldif entries) for each test I am running? I thought of the following: 1) Indicate that the method

Spring Security with LDAP and Database roles

醉酒当歌 提交于 2019-12-04 01:24:32
问题 In our new insurance project, I am trying to implement spring-security with Ldap active-directory. I want to just check username/password against AD, once user found in AD. I want to authorize him from user table(app authorized users) with access levels in database. Could someone give sample/point me for a good resource. 回答1: The easiest way to achieve this now (Spring Security 3.2.5.RELEASE) is by implementing a custom LdapAuthoritiesPopulator which uses a custom JdbcDaoImpl to obtain the

Multiple LDAP repositories with Spring LDAP Repository

自作多情 提交于 2019-12-03 20:47:12
I would like to set more than one LDAP repositories with Spring LDAP. My aim is to create or update objects in all repositories at the same time. I use LdapRepository Spring interface and I think that isn't possible for now. I wonder if I can create my own LdapRepository extending the Spring one but I have no idea how to start. This my configuration : @Configuration @EnableLdapRepositories("com.xxx.repository.ldap") @PropertySource("classpath:ldap.properties") public class LdapConfiguration { @Autowired Environment ldapProperties; @Bean public LdapContextSourceCustom contextSourceTarget() {

javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]

◇◆丶佛笑我妖孽 提交于 2019-12-03 12:10:35
I'm new to ldap and I was trying what I thought was a trivial example to test the spring ldap module with an ldap instance that someone had already setup for testing. Details about the ldap instance that I am using can be found here: http://blog.stuartlewis.com/2008/07/07/test-ldap-service/comment-page-3/ I've used an ldap browser/admin tool (Softerra LDAP Admin) and I can access the directory without any issues. When I try it using java and spring-ldap (2.0.1) I get the Authentication Exception mentioned above. Before setting up my own ldap instance to try and troubleshoot this further I

Do we need to write CustomActiveDirectoryLdapAuthenticationProvider if we want to get user details from ActiveDirectory

让人想犯罪 __ 提交于 2019-12-02 06:48:54
问题 If we need to get User attributes from ActiveDirectory like name, sn etc. can't we configure using Specialized LDAP authentication provider which uses Active Directory configuration conventions like "springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider" @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .authorizeRequests()