On Wed, Feb 11, 2015 at 11:19:40AM +0530, Bharath K wrote:
this is my java code where i can get output for "none" authentication when i use "simple" authentication its not working...
env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=Manager, ou=People,dc=example,dc=com");
That DN is not in the LDIF data that you posted. It might be set as the rootDN for the database, but we need to see the OpenLDAP configuration to know whether it is right (either the slapd.conf file or an LDIF dump of everything under cn=config depending on which config system you are using).
env.put(Context.SECURITY_CREDENTIALS, "ldap123"); // env.put(Context.SECURITY_CREDENTIALS, "{SSHA}rZe5WkunQdmRkyCcEHu9g6VsqRecnzIa");
Note that you must send the plain-text password. The SSHA hash is only used in server config or in LDAP entries.
this is my LDIF file
# nagios, People, example.com dn: uid=nagios,ou=People,dc=example,dc=com objectClass: inetOrgPerson objectClass: posixAccount objectClass: shadowAccount uid: nagios sn: nagios givenName: nagios cn: nagios displayName: nagios uidNumber: 500 gidNumber: 500 userPassword:: secret
If you want to set the password to 'secret' then you should only have one colon:
userPassword: secret
Using :: means that the data is Base-64 encoded.
Please post the OpenLDAP configuration so that we can check the DNs and passwords.
Please also reload the data with the correct userPassword values and try:
env.put(Context.SECURITY_PRINCIPAL, "uid=nagios,ou=People,dc=example,dc=com"); env.put(Context.SECURITY_CREDENTIALS, "secret");
VERY IMPORTANT: please post the actual data and the real passwords that you are using to test with. If they are really secret, then change them to something trivial BEFORE doing the tests.
Andrew