Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is the WLS 7.0 embedded ldap admin account and password?

1 view
Skip to first unread message

K Wong

unread,
Jun 19, 2002, 3:03:57 PM6/19/02
to
I am using (javax.naming.directory.DirContext.modifyAttributes) to change
password to our development Weblogic 7.0 embedded LDAP.

I login as the system administrator (a user in the administrators group),
but always gets the javax.naming.NoPermissionException - Insufficient Access
Rights.

What user should I use? Any help will be appreciated.


Neil Smithline

unread,
Jun 19, 2002, 3:17:49 PM6/19/02
to
Two things. First, I'm not exactly sure what password you are trying to
change. The LDAP server's password or a user's password in the LDAP
server. Second, could you please post a stack trace.

Thanks - Neil

K Wong

unread,
Jun 19, 2002, 3:53:55 PM6/19/02
to
I need to change password for a user. Any help will be appreciated.

Here is my stack trace:

c:\Test>java -classpath . testEmbeddedLdap
attribute: uid
attribute: description
attribute: objectclass
attribute: wlsMemberOf
attribute: sn
attribute: cn
javax.naming.NoPermissionException: [LDAP: error code 50 - Insufficient
Access Rights]; remaining name
'uid=myRegularUser,ou=people,ou=myrealm,dc=mydomain'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2872)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2810)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2616)
at com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(LdapCtx.java:1374)
at
com.sun.jndi.toolkit.ctx.ComponentDirContext.p_modifyAttributes(ComponentDir
Context.java:255)
at
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(Partial
CompositeDirContext.java:172)
at
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(Partial
CompositeDirContext.java:161)
at
javax.naming.directory.InitialDirContext.modifyAttributes(InitialDirContext.
java:146)
at testEmbeddedLdap.main(testEmbeddedLdap.java:30)

Here is my testing code:
<PRE>
import java.util.*;
import javax.naming.*;
import javax.naming.directory.*;

public class testEmbeddedLdap {
public static void main(String[] argv) {
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost:7001");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "uid=myAdministrator, ou=people,
ou=myrealm, dc=mydomain");
env.put(Context.SECURITY_CREDENTIALS, "myAdministrator");
try {
DirContext ctx = new InitialDirContext(env);

String
sUser="uid=myRegularUser,ou=people,ou=myrealm,dc=mydomain";
String sOldPassword="myRegularUser";
String sNewPassword="newpassword";

for (NamingEnumeration ae = ctx.getAttributes(sUser).getAll();
ae.hasMore(); ) {
Attribute attr = (Attribute)ae.next();
System.out.println("attribute: " + attr.getID());
}

ModificationItem[] mods = new ModificationItem[2];
Attribute mod0 = new BasicAttribute("userpassword",
sOldPassword);
mods[0] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE,
mod0);
Attribute mod1 = new BasicAttribute("userpassword",
sNewPassword);
mods[1] = new ModificationItem(DirContext.ADD_ATTRIBUTE, mod1);
ctx.modifyAttributes(sUser, mods);

ctx.close();
} catch (NamingException e) {
e.printStackTrace();
}
}
}
</PRE>


"Neil Smithline" <Ne...@Reply-in-newsgroup.com> wrote in message
news:3D10D8DD...@Reply-in-newsgroup.com...

0 new messages