Maybe an admin can move the thread to spring-security.
I am back with this error as it is one of the last issues to sort out.
I tried updating to spring-security 3.1.3.RELEASE, spring to 3.0.6.RELEASE but the error is still there. Now at least I have a stack trace.
First login attempt with error:
Code:
2012-12-07 10:44:29,598 [qtp6825008-24] DEBUG org.springframework.security.ldap.DefaultSpringSecurityContextSource - Removing pooling flag for user uid=efedrep,ou=users,ou=Internal,o=company
2012-12-07 10:44:30,006 [qtp6825008-24] DEBUG org.springframework.security.ldap.authentication.BindAuthenticator - Retrieving attributes...
2012-12-07 10:44:30,192 [qtp6825008-24] DEBUG org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator - Getting authorities for user uid=efedrep,ou=users,ou=Internal,o=company
2012-12-07 10:44:30,192 [qtp6825008-24] DEBUG org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator - Searching for roles for user 'efedrep', DN = 'uid=efedrep,ou=users,ou=Internal,o=company', with filter (uniqueMember={0}) in search base ''
2012-12-07 10:44:30,193 [qtp6825008-24] DEBUG org.springframework.security.ldap.SpringSecurityLdapTemplate - Using filter: (uniqueMember=uid=efedrep,ou=users,ou=Internal,o=company)
2012-12-07 10:44:30,200 [qtp6825008-24] INFO org.springframework.ldap.core.LdapTemplate - The returnObjFlag of supplied SearchControls is not set but a ContextMapper is used - setting flag to true
2012-12-07 10:44:30,358 [qtp6825008-24] DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2012-12-07 10:44:30,359 [qtp6825008-24] DEBUG org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
2012-12-07 10:44:30.359:WARN:oejs.ServletHandler:/boat2/j_spring_security_check
org.springframework.ldap.AuthenticationException: [LDAP: error code 32 - No Such Object]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 32 - No Such Object]
at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:182)
at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:266)
at org.springframework.ldap.core.support.AbstractContextSource.getContext(AbstractContextSource.java:106)
at org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:125)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:287)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:259)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:606)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:524)
at org.springframework.security.ldap.SpringSecurityLdapTemplate.searchForSingleAttributeValues(SpringSecurityLdapTemplate.java:173)
at org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator.getGroupMembershipRoles(DefaultLdapAuthoritiesPopulator.java:215)
at org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator.getGrantedAuthorities(DefaultLdapAuthoritiesPopulator.java:185)
at org.springframework.security.ldap.authentication.LdapAuthenticationProvider.loadUserAuthorities(LdapAuthenticationProvider.java:197)
at org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider.authenticate(AbstractLdapAuthenticationProvider.java:63)
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156)
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)
at
...
Caused by:
javax.naming.AuthenticationException: [LDAP: error code 32 - No Such Object]
at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:290)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2740)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:316)
Second attempt goes fine:
Code:
2012-12-06 17:09:52,845 [qtp17518647-22] DEBUG org.springframework.security.ldap.DefaultSpringSecurityContextSource - Removing pooling flag for user uid=efedrep,ou=users,ou=Internal,o=company
2012-12-06 17:09:53,251 [qtp17518647-22] DEBUG org.springframework.security.ldap.authentication.BindAuthenticator - Retrieving attributes...
2012-12-06 17:09:53,341 [qtp17518647-22] DEBUG org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator - Getting authorities for user uid=efedrep,ou=users,ou=Internal,o=company
2012-12-06 17:09:53,342 [qtp17518647-22] DEBUG org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator - Searching for roles for user 'efedrep', DN = 'uid=efedrep,ou=users,ou=Internal,o=company', with filter (uniqueMember={0}) in search base ''
2012-12-06 17:09:53,342 [qtp17518647-22] DEBUG org.springframework.security.ldap.SpringSecurityLdapTemplate - Using filter: (uniqueMember=uid=efedrep,ou=users,ou=Internal,o=company)
2012-12-06 17:09:53,343 [qtp17518647-22] INFO org.springframework.ldap.core.LdapTemplate - The returnObjFlag of supplied SearchControls is not set but a ContextMapper is used - setting flag to true
2012-12-06 17:09:53,465 [qtp17518647-22] DEBUG org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator - Roles from search: [EP_ESS_01_A_MUS]
2012-12-06 17:09:53,469 [qtp17518647-22] DEBUG org.springframework.security.ldap.userdetails.LdapUserDetailsMapper - Mapping user details from context with DN: uid=efedrep,ou=users,ou=Internal,o=company
Haven't modified much of the spring security but here it is:
Code:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<security:http create-session="never" auto-config="false">
<security:intercept-url pattern="/spring/main/**" access="ROLE_ADMIN, ROLE_MANAGER, ROLE_TEAMLEADER" />
<security:access-denied-handler error-page="/spring/denied" />
<security:form-login authentication-failure-url="/spring/login?login_error=1" default-target-url="/spring/main"
login-processing-url="/j_spring_security_check" login-page="/spring/login" />
<security:logout logout-success-url="/spring/logoutSuccess" logout-url="/spring/logout" />
<security:http-basic />
</security:http>
<bean class="com.company.boat.login.service.CustomUserDetailsMapper" id="customUserContextMapper" />
<security:authentication-manager>
<security:ldap-authentication-provider user-context-mapper-ref="customUserContextMapper" user-dn-pattern="uid={0},ou=users,ou=Internal,o=company" />
</security:authentication-manager>
<security:ldap-server manager-password="PWD" manager-dn="uid=Uname,ou=Users,ou=Internal,o=company" url="ldap://egd.company.es" />
</beans>
What it catches my attention is why the first time logs
Code:
org.springframework.security.web.context.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
and the second one
Code:
org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator - Roles from search: [EP_ESS_01_A_MUS]
org.springframework.security.ldap.userdetails.LdapUserDetailsMapper - Mapping user details from context with DN: uid=efedrep,ou=users,ou=Internal,o=company
Any help would be very appreciated!