Hi Friends,
I have to do a Simple login authentication using LDAP in GWT.
I had done in Java.But i don't know to implement the same in GWT.
Help me if anyone knows...
I pasted here my java source here :
package com.ldap.test;
import java.util.*;
import javax.naming.*;
import javax.naming.directory.*;
public class ldaptest {
@SuppressWarnings("unchecked")
public static void main(String[] args) {
try {
@SuppressWarnings("rawtypes")
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,
"LDAP://localhost:389"); //replace with your server URL/IP
//only DIGEST-MD5 works with our Windows Active Directory
env.put(Context.SECURITY_AUTHENTICATION,
"Simple"); //No other SALS worked with me
env.put(Context.SECURITY_PRINCIPAL,
"uid=karthick,ou=users,ou=system"); // specify the username ONLY to let Microsoft Happy
env.put(Context.SECURITY_CREDENTIALS, "karthick"); //the password
DirContext ctx = new InitialDirContext(env);
ctx.close();
enter code here
} catch(NamingException ne) {
System.out.println("Error authenticating user:");
System.out.println(ne.getMessage());
return;
}
//if no exception, the user is already authenticated.
System.out.println("OK, successfully authenticating user");
}
}
// samething i have to do in GWT..