This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Security and the fly likes Authenticate weblogic security realm user against LDAP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Authenticate weblogic security realm user against LDAP" Watch "Authenticate weblogic security realm user against LDAP" New topic
Author

Authenticate weblogic security realm user against LDAP

Benjamin Ten
Greenhorn

Joined: Dec 05, 2012
Posts: 3
I have installed weblogic '10.3.4.0' and created a domain 'business' and created a user 'businessuser' in the default security realm 'myrealm'. The authenticator is a DefaultAuthenticator as in weblogic. Now, I want to authenticate the user in my standalone java application using LDAP. I have also tried changing the LDAP credentials. After executing the application, the system is responding with the following error: javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]. Is there any configuration to be done in weblogic that I am missing?

***** CODE-START *****

Properties l_props = new Properties();
LdapContext l_ctx = null;
l_props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
l_props.put(Context.PROVIDER_URL, "ldap://localhost:7001");
l_props.put(Context.SECURITY_AUTHENTICATION, "simple");
l_props.put(Context.SECURITY_PRINCIPAL, "cn=username");
l_props.put(Context.SECURITY_CREDENTIALS, "password");
l_ctx = new InitialLdapContext(l_props, null);

***** CODE-END *****

***** EXCEPTION-START *****

javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3041)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2987)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2789)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2703)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:293)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:134)
at com.iflex.fcat.misc.TestLDAP.createInitialLdapContext(TestLDAP.java:258)
at com.iflex.fcat.misc.TestLDAP.authenticate(TestLDAP.java:170)
at com.iflex.fcat.misc.TestLDAP.main(TestLDAP.java:125)

***** EXCEPTION-END *****
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Authenticate weblogic security realm user against LDAP
 
Similar Threads
ldap authentication using ssl
Authenticate weblogic security realm user against LDAP
unable to do ssl authentication using ldaps
LDAP: error code 48 - anonymous bind disallowed
LDAP authentication using ssl