spring-ldap

Spring LdapRepository returns no results while Spring Security works

懵懂的女人 提交于 2020-01-05 07:33:30
问题 My Problem I am using an LdapRepository to get user information from an Ldap server. This Ldap server is also queried by Spring Security to authenticate user. My issue is, that Spring Security is able to find and identify users, while I'm unable to find users through my LdapRepository, using the same LdapContextSource. Querying the LdapRepository in any way does not return results ( null or empty Lists). What I have tried Using the ldapsearch tool directly - Works Using LdapQuery instead of

NoClassDefFoundError in Websphere — JARs are present

拈花ヽ惹草 提交于 2020-01-02 16:23:30
问题 I have a simple Spring MVC application that looks up some user details from an LDAP server and prints out a simple HTML page using a JSP. The application works fine on Tomcat 6. It uses Spring LDAP 1.3.1 and LDAPTemplate to do the LDAP lookups. However, when I deploy this application WAR to Websphere 7, the app doesn't run -- Websphere returns a 500 Internal server error. Looking at Websphere's log file, I see [14/12/10 14:50:09:169 GMT] 00000022 DispatcherSer E org.springframework.web

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

做~自己de王妃 提交于 2020-01-01 12:20:10
问题 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(

using spring-ldap with ssl

孤街浪徒 提交于 2019-12-30 04:35:32
问题 I need to talk to an LDAP server via spring-ldap with SSL, and the other end has a self-signed certificate no less. Can any kind soul please point me to some instructions for setting this up? 回答1: Check out Spring LDAP documentation for connecting to LDAP server over HTTP(S): As far as self signed certificate is concerned, you can import certificate chain into a truststore and set the following VM arguments: -Djavax.net.ssl.trustStore="<path to truststore file>" -Djavax.net.ssl

Incorrect injection between beans

孤街浪徒 提交于 2019-12-25 09:42:35
问题 I am attempting create two beans for ldap connections. In my context.xml file I create two LdapContextSource and then auto wire two beans with same parent class , derived like the PersonDao and PersonDaoImpl in the spring ldap examples. The issue I keep getting is that both beans end up with the same context source. Even after I used @AutoWired @Qualifier . The debug shows that both singleton beans see a different LdapContextSource but in the end both beans have same context. Is there an

LdapRepository update spring-ldap

泄露秘密 提交于 2019-12-25 03:02:18
问题 Spring LdapRepository save() method throws exception when I'm trying to update an existing object in LDAP database. org.apache.directory.api.ldap.model.exception.LdapEntryAlreadyExistsException: ERR_250_ENTRY_ALREADY_EXISTS What method should I use to update existing ldap objects? Person class: @Entry(objectClasses = { "inetOrgPerson", "organizationalPerson", "person", "top" }) public class Person implements Serializable { public Person() { } @Id private Name dn; @Attribute(name = "cn")

Spring security configuration to authenticate ldap user

随声附和 提交于 2019-12-24 12:15:31
问题 I've been working on Spring web application in our company which authenticates users from database. But we are wanted to use the active directory server in our company for this purpose instead of database. unfortunately, I have a trouble to connect to the server. Here is my spring-security.xml <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001

How to change password using Spring LDAP and Spring security

大城市里の小女人 提交于 2019-12-24 00:49:26
问题 I'm using latest version of both Spring LDAP and Spring security. Also, I'm using annotation based configuration and I have no XML configuration files. What I'm trying to achieve is really basic, I want to be able to allow users to change their password from my web application. I've found that I could execute that request through DirContext.modifyAttributes. This method requires two attributes, the first one is the current userDn, which I'm not sure how to easily get through Spring. I'm

SpEL not supported in Spring annotation @Entry.base

安稳与你 提交于 2019-12-23 10:54:46
问题 I use Spring Data LDAP and Spring Boot provides out of the box support for an embedded UnboundID server. However, when I use Spring Data LDAP's @Entry annotation, I need to specify a different base in the annotation based on whether I'm using the embedded UnboundID LDAP server, or a remote Active Directory server. I was attempting to do this with SpEL and profile-based properties by specifying: @Entry(base = "${ldap.person.base}", ...) Then I have an application.propreties with ldap.person

Multiple LDAP repositories with Spring LDAP Repository

荒凉一梦 提交于 2019-12-21 06:22:19
问题 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 {