[Date Prev][Date Next] [Chronological] [Thread] [Top]

error while accessing through Java "javax.naming.AuthenticationNotSupportedException: simple"



I am new to openLDAP. I am configuring it (version: OpenLDAP: slapd 2.3.27) on a Linux machine to use with our Web Application (java). When I try and make a connection I am getting the following error.



javax.naming.AuthenticationNotSupportedException: simple

[4/7/08 10:42:01:887 EDT] 00000026 SystemErr     R    at com.sun.jndi.ldap.sasl.LdapSasl.saslBind(LdapSasl.java:115)



These are the code / attributes I used.



        Hashtable env = new Hashtable();

        env.put( Context.INITIAL_CONTEXT_FACTORY, “com.sun.jndi.ldap.LdapCtxFactory” );

        env.put( Context.PROVIDER_URL, “ldap://<machine name>:<port>” );

        env.put( Context.SECURITY_PRINCIPAL, “cn=uimadmin,ou=UIM,o=nhes,dc=nh,dc=gov” );

        env.put( Context.SECURITY_AUTHENTICATION, “simple” );

        env.put( Context.SECURITY_CREDENTIALS, “<password in plaintext>” );



            context = new InitialDirContext(env);

            System.out.println("CONTEXT OPENED WITH ADMIN ACCOUNT");  


        catch (NamingException ne)

        {   ne.printStackTrace();

            LogManager.logMessage("LDAPManager.getAdminJndiContext()", ne);


        return context;




When I try and do an ldapsearch with a –x option (simple authentication) on the command line, it is returning results successfully. I am also able to connect using ldapbrowser v2.8.2 and see the results.


Any help regarding this is greatly appreciated.


Thanks in advance.