Open Directory Authentication Using JNDI
Open Directory Authentication Using JNDI
- Subject: Open Directory Authentication Using JNDI
- From: King Chung Huang <email@hidden>
- Date: Sat, 21 Apr 2007 16:09:03 -0600
I have Mac OS X Server set up on a Mac with Open Directory's role set
to Open Directory Master, and I'm trying to figure out how to
authenticate users using JNDI. I'm still learning both LDAP and Open
Directory and I'm not having much luck figuring out what's wrong with
my code. Here's the relevant code.
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://10.0.1.2/");
env.put(Context.SECURITY_PRINCIPAL,
"cn=theusername,dc=dotmac,dc=local");
env.put(Context.SECURITY_CREDENTIALS, "thepassword");
try {
DirContext ctx = new InitialDirContext(env);
ctx.close();
} catch (Exception e) {
e.printStackTrace();
}
I always get back an AuthenticationException (LDAP: error code 49 -
Invalid Credentials). I'm not sure why. Is there something extra that
I need to do on the server to enable LDAP bind operations? Is there
something wrong with the security principal?
Thanks,
King Chung Huang
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden