Link to home
Start Free TrialLog in
Avatar of Wesley Costa
Wesley Costa

asked on

Java LDAP Connection With AD DS

I developed a web site to connect through ldap connection mechanism on AD DS windows server, but I'm getting an error called GSSAPI only this error, please someone can explain or give some help to connect with Active Directory through LDAP connection ?
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Check this if it works for you
Avatar of Wesley Costa
Wesley Costa

ASKER

Hi John, thanks.. i have tried that last time but still not working
this is my code...

            String providerURL = obterParametro("providerURL");
            String securityAuthentication = obterParametro("securityAuthentication");
            String securityPrincipal = obterParametro("securityPrincipal");
            String propriedadeUsuario = obterParametro("propriedadeUsuario");

            Hashtable env = new Hashtable();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
            env.put(Context.SECURITY_AUTHENTICATION, securityAuthentication);
            env.put(Context.REFERRAL, "ignore");
            env.put("com.sun.jndi.ldap.connect.pool", "false");
            env.put("com.sun.jndi.ldap.connect.timeout", "300000");
            env.put(Context.PROVIDER_URL, providerURL);
            env.put(Context.SECURITY_PRINCIPAL, String.format(securityPrincipal, usuario));
            env.put(Context.SECURITY_CREDENTIALS, senha);


where

providerURL is ldap://192.168.1.7:389/
securityAuthentication is GSSAPI
securityPrincipal is the user login
ASKER CERTIFIED SOLUTION
Avatar of Wesley Costa
Wesley Costa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial