Hello,
I want to use openldap with WINDOWS XP. i use ILEX (version opendlap windows). i want to implement the MakeRoot.java but i have got this problem :
javax.naming.AuthentificationException: [LDAP: error code 49 - 8009030C: LdapErr: DSID-0C090311, comment: AcceptSecurityContext error, data 2030, va28 ]
my configuration :
sladp.conf
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
#ucdata-path "C:/Archivos de programa/OpenLDAP/ucdata"
include "C:/Archivos de programa/OpenLDAP/schema/core.schema"
include "C:/Archivos de programa/OpenLDAP/schema/cosine.schema"
include "C:/Archivos de programa/OpenLDAP/schema/inetorgperson.schema"
#include "C:/Archivos de programa/OpenLDAP/schema/nis.schema"
#include "C:/Archivos de programa/OpenLDAP/schema/corba.schema"
#include "C:/Archivos de programa/OpenLDAP/schema/java.schema"
#include "C:/Archivos de programa/OpenLDAP/schema/krb5-kdc.schema"
#include "C:/Archivos de programa/OpenLDAP/schema/openldap.schema"
# Define global ACLs to disable default read access.
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
pidfile "C:/Archivos de programa/OpenLDAP/slapd.pid"
argsfile "C:/Archivos de programa/OpenLDAP/slapd.args"
sasl-secprops none
# Load dynamic backend modules:
# modulepath %MODULEDIR%
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la
# Enable TLS if port is defined for ldaps
#TLSVerifyClient never
#TLSCertificateFile "C:/Archivos de programa/OpenLDAP/server.pem"
#TLSCertificateKeyFile "C:/Archivos de programa/OpenLDAP/serverkey.pem"
#TLSCACertificateFile "C:/Archivos de programa/OpenLDAP/CA.pem"
#
# Sample access control policy:
# Allow read access of root DSE
# Allow self write access
# Allow authenticated users read access
# Allow anonymous users to authenticate
#
#access to dn="" by * read
#access to *
# by self write
# by users read
# by anonymous auth
# Directives needed to implement policy:
#access to dn="" by dn="uid=update,ou=people,dc=ilex-si,dc=com" write
#access to * by * none
#
# if no access controls are present, the default policy is:
# Allow read by all
#
# rootdn can always write!
#######################################################################
# database backend definitions
#######################################################################
database ldbm
suffix "o=jndiTest"
rootdn cn=Manager, o=jndiTest
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# rootpw {SSHA}yeqw767MW3rcawL8/rO/5GghRYCA+1i5
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd/tools. Mode 700 recommended.
directory "C:/Archivos de programa/OpenLDAP/data"
schemacheck off
# Indices to maintain
index default pres,eq
index uid,cn,sn
index objectClass eq
MakeRoot.java
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.naming.NameAlreadyBoundException;
import javax.naming.directory.*;
import java.util.*;
public class MakeRoot {
final static String ldapServerName = "localhost";
final static String rootdn = "cn=Manager, o=jndiTest";
final static String rootpass = "secret";
final static String rootContext = "o=jndiTest";
public static void main( String[] args ) {
// set up environment to access the server
Properties env = new Properties();
env.put( Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory" );
env.put( Context.PROVIDER_URL, "ldap://" + ldapServerName + "/" );
env.put( Context.SECURITY_PRINCIPAL, rootdn );
env.put( Context.SECURITY_CREDENTIALS, rootpass );
try {
// obtain initial directory context using the environment
DirContext ctx = new InitialDirContext( env );
// now, create the root context, which is just a subcontext
// of this initial directory context.
ctx.createSubcontext( rootContext );
} catch ( NameAlreadyBoundException nabe ) {
System.err.println( rootContext + " has already been bound!" );
} catch ( Exception e ) {
System.err.println( e );
}
}
}
// end MakeRoot.java
thank you
nicolas