Simple Login Screen using LDAP in GWT -
hi friends,
i have simple login authentication using ldap in gwt. had done in java.but don't know implement same in gwt. me if knows...
pasted here 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 server url/ip //only digest-md5 works our windows active directory env.put(context.security_authentication, "simple"); //no other sals worked me env.put(context.security_principal, "uid=karthick,ou=users,ou=system"); // specify username 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, user authenticated. system.out.println("ok, authenticating user"); } }
// samething have in gwt..
implement remote servlet service, pass username , credentials service through asynchronous callback in client side. above code can work implementation.
Comments
Post a Comment