spring-ldap

Implementation of timeout in LDAP

血红的双手。 提交于 2019-12-12 10:01:21
问题 I have been handling an application in which we are using LDAP to fetch user details. Sometimes it will take more time to fetch user details. I want to implement time out on methods that fetch details so that we can avoid hanging transactions in server in worst case. Here we are using LdapUtil class in which we have configured LdapTemplate class to fetch the required details. How can we implement timeout on LDAP methods? (In this case ldapTemplate.search(...) methods) public class LdapUtil {

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

百般思念 提交于 2019-12-12 07:48:00
问题 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

Ldap error code 32 while adding user to ldap

别说谁变了你拦得住时间么 提交于 2019-12-12 04:24:39
问题 I need to add a new user entry to my ldap. Following is my code: javax.naming.Name name = new DistinguishedName("cn=" + userName +",ou=Users,dc=wso2,dc=org"); Attribute objectClass = new BasicAttribute("objectClass"); { objectClass.add("top"); objectClass.add("inetOrgPerson"); objectClass.add("person"); objectClass.add("organizationalPerson"); } Attributes userAttributes = new BasicAttributes(); userAttributes.put(objectClass); userAttributes.put("cn", userName); userAttributes.put("sn",

Fetching LDAP attribute memberof inside Grails Spring application

不问归期 提交于 2019-12-12 04:22:21
问题 I am stuck possibly at a very stupid question, trying to implement LDAP role based authentication/authorization in a Grails application (bookstore) using spring-security-core and spring-security-ldap plugins. I created a custom UserDetailsContextMapper and trying to map my LDAP role with application role. However, the memberof attribute is never returned in the attributes. UserDetails mapUserFromContext(DirContextOperations ctx, String username, Collection authorities) { Attributes attributes

Invocation of init method failed; nested exception is java.lang.AbstractMethodError

只愿长相守 提交于 2019-12-12 03:16:21
问题 I'm trying to manage user and groups of LDAP through a Spring Boot application and I'm referring from here https://github.com/spring-projects/spring-ldap/tree/master/samples/user-admin but instead of using XML configuration, I used Java based configuration. This is my current code https://github.com/wmfairuz/spring-ldap-user-admin And this is my current error: ... 2015-12-22 18:18:39.514 INFO 8824 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet'

Custom LDAP authentication using Spring Security 4

百般思念 提交于 2019-12-12 03:14:01
问题 In my non Spring Security application, we used LDAP to authenticate users by connecting to the LDAP server using his ID and password. If the connection was successful, then the user was authenticated and his details were gotten from LDAP. Below is the code for that: private void getLdapConnection(UserSignInObject userSignInObject) { LdapContextSource ctxSrc = new LdapContextSource(); ctxSrc.setUrl("ldap://mjkoldc-03.red.com"); ctxSrc.setUserDn("mj\\" + userSignInObject.getEmail()); ctxSrc

Can a spring ldap repository project access two different ldap directories?

╄→гoц情女王★ 提交于 2019-12-12 03:04:16
问题 I am trying to create a spring rest application to return values that may come from two different ldap directory servers. Is this possible using spring ldap repositories? Is it possible to create more than one ldaptemplate and contextsource so I can query both directories? 回答1: You can configure separate ldapTemplate and contextSource beans for each LDAP directory. You can refer to the following basic configuration (JavaConfig); @Configuration @EnableLdapRepositories(basePackages = "com.foo

Spring security - specific users

允我心安 提交于 2019-12-11 14:47:34
问题 I am using ldap for authentication of requests. I have configured by extending WebSecurityConfigurerAdapter and overriding configure(HttpSecurity) and configure(AuthenticationManagerBuilder) methods. The credentials will be verified using ldap and on top of that, I need to maintain a static list that contains specific usernames to be allowed to access. Can anyone help with the usernames validation part - do I need to write an extension of AuthenticationProvider to validate credentials and

Spring ldap authentication failed error codes

六眼飞鱼酱① 提交于 2019-12-11 09:56:40
问题 I'm using Spring LDAP (1.3.1) to talk to ADAM and Active Directory. When I try to authenticate someone using ldapTemplate.authenticate() I get back errors via the error callback, but it gives a very generic exception AuthenticationException and I cannot extract what exactly is the problem: account disabled password expired must change password on next login account expired etc All I get back is a detailMessage which I assume is what AD sends back. Something like: org.springframework.ldap

Spring Ldap - multipe base names

放肆的年华 提交于 2019-12-11 09:46:18
问题 I am just trying out spring ldap /odmnow. Seems interesting and cool. sorry if the below question is too dumb! I am trying to use spring ldap /odm to retreive some attributes from out ldap.Is there is a way to configure multiple base names in or in @Entry(objectClasses = { "person"} base={..CAN I GIVE MULTIPLE BASENames here..}) public class LdapUser { @Id private Name dn; The app I am developing has users defined under one OU and internal TESTERs defined in another ou in our AD. So I am