invalid credentials
invalid credentials
- Subject: invalid credentials
- From: ".::welemski::." <email@hidden>
- Date: Fri, 7 Oct 2005 10:53:37 +0800
Hi,
I tried binding to ldap using this syntax in webobjects
String strCredentials;
// strCredentials="uid="+varUsername+",cn=users";
// Set up environment for creating initial context
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,
"ldap://server.domain.com:389/dc=server,dc=comainl,dc=com");
// Authenticate as S. User and password "mysecret"
env.put(Context.SECURITY_AUTHENTICATION, "simple");
//env.put(Context.SECURITY_PRINCIPAL, "cn=S. User, ou=NewHires,
o=JNDITutorial");
env.put(Context.SECURITY_PRINCIPAL, "cn=Directory
Administrator,dc=domain,dc=com");
env.put(Context.SECURITY_CREDENTIALS, "mypassword");
try {
// Create initial context
DirContext ctx = new InitialDirContext(env);
System.out.println(ctx.lookup("ou=People"));
// do something useful with ctx
varResult=":D";
// Close the context when we're done
ctx.close();
} catch (NamingException e) {
varResult=":(";
e.printStackTrace();
}
but I get an error, "Invalid Credentials". my password is correct
--
-- -- -- -- -- -- -- -- -- -- --
welemski
-- -- -- -- -- -- -- -- -- -- --
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden