This content has been marked as final.
Show 2 replies
-
1. Re: LDAP: client-side authentication
starksm64 Jul 30, 2005 12:07 PM (in response to schachi)The same ldap login module that works on the server side.
-
2. Re: LDAP: client-side authentication
schachi Aug 2, 2005 2:39 PM (in response to schachi)thank you for reply.
here is an example (if someone else has the same problem... )
client:try { System.setProperty("java.security.auth.login.config", "...pathtoauthconf\\auth.conf"); org.jboss.security.auth.callback.UsernamePasswordHandler handler = new org.jboss.security.auth.callback.UsernamePasswordHandler(userid, password.toCharArray()); final javax.security.auth.login.LoginContext lc = new javax.security.auth.login.LoginContext("testPolicy", handler); lc.login(); } catch (Exception ex) { // login failed }
auth.conf:testPolicy { org.jboss.security.ClientLoginModule required; org.jboss.security.auth.spi.LdapLoginModule required java.naming.factory.initial="com.sun.jndi.ldap.LdapCtxFactory" java.naming.provider.url="ldap://localhost:389/" java.naming.security.authentication="simple"; rolesCtxDN="ou=Roles,dc=eactAG,dc=ch" matchOnUserDN="true" principalDNSuffix=",ou=People,dc=eactAG,dc=ch" principalDNPrefix="uid=" uidAttributeID="userid" roleAttributeID="roleName" roleAttributeIsDN="false" };