LDAP: error code 49 - Invalid Credentials
hi,
I have Debian Sarge and openLDAP,When i try to insert new entries creates problem more i am getting that exception while using LdapTemplate.authenticate method.i am getting uid and password from JSP and on valid password the method return TRUE, but on wrong password, the throws exception :
Exception :
org.springframework.ldap.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
Caused by: javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.jav a:2985)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCt x.java:2931) AndFilter filter = new AndFilter()
.and(new EqualsFilter(LDAPEnum.OBJ_CLASS.getValue(), LDAPEnum.PERSON_CLASS.getValue()))
.and(new EqualsFilter(LDAPEnum.UID.getValue(), uid));
Re: LDAP: error code 49 - Invalid Credentials
A typical ldif might look like this:
Code:
Quote:
# Root Organization
dn: dc=example,dc=com
dc: example
objectClass: dcObject
objectClass: organization
o: Example Inc
# Barbara's Entry
dn: cn=Barbara J Jensen, dc=example, dc=com
cn: Barbara J Jensen
objectClass: person
gn: Barbara
sn: Jensen
I can't say I've ever used the o=example,c=com format, but assuming it works the same way as using dc=, then you're missing the dn: prefix on the line for o=litho,c=com as well as on the cn=Manager, o=litho, c=com line. You should also change a lot of those equal signs to colons. So fixing it up, I would guess that your ldif should look more like this:
Code:
Quote:
dn: o=litho, c=com
objectClass: organization
o: litho
description: litho
dn: cn=Manager, o=litho, c=com
objectClass: organizationalRole
cn: Manager
description: manager
and maybe you might want to add objectClass=dcObject to the first entry too? If I were doing it, I'd write it as such:
Code:
Quote:
dn: dc=litho,dc=com
dc: litho
objectClass: dcObject
objectClass: organization
o: litho
description: litho
dc: cn=Manager, dc=litho, dc=com
objectClass: organizationalRole
cn: Manager
description: manager
Re: LDAP: error code 49 - Invalid Credentials
Re: LDAP: error code 49 - Invalid Credentials
Type visudo to edit /etc/sudoers rather than another text editor (vi, nano, nedit, gedit, etc). Visudo provides basic sanity checks, looks for parse errors, and locks the sudoers file against multiple simultaneous edits (say you we're in a multi-admin environment).
If requiretty is set sudo will only run when the user is logged in to a real tty. Requiring it disallows things like 'rsh somehost sudo ls' since rsh does not allocate a tty, etc, etc. Here we're turning it off because it's saying "you must have a tty to run sudo".