Please help w/ ldaploginmodule
lords_diakonos Mar 9, 2004 1:59 PMI am new to Jboss and relativly new to Java. I downloaded the ldap module from http://www.boxerboxes.ca/JBoss_Ldap.html and deployed the jar file. I also added the following to my login-config
<application-policy name = "AD"> <authentication> <login-module code="org.jboss.security.auth.spi.BrowseLdapLoginModule" flag = "required"> <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option> <module-option name="java.naming.provider.url">ldap://nmi.northlandministries.org/</module-option> <module-option name="java.naming.security.authentication">simple</module-option> <module-option name="java.naming.security.protocol">ssl</module-option> <module-option name="browseUserDN">CN=auser,OU=ou,DC=northlandministries,DC=org</module-option> <module-option name="browseUserPassword">secret</module-option> <module-option name="userMatchAttribute">sAMAccountName</module-option> <module-option name="userSearchBaseDN">OU=ou,DC=northlandministries,DC=ca</module-option> <module-option name="roleAttributeID">memberOf</module-option> <module-option name="dereferenceRoleAttribute">cn</module-option> </login-module> </authentication> </application-policy>
I have a servlet created that I am trying to test this all with. What do I need in the web.xml file and the jboss-web.xml file both are posted below.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>WebMessage</display-name> <login-config> <auth-method>BASIC</auth-method> </login-config> <security-constraint> <web-resource-collection> <web-resource-name>WebMessage</web-resource-name> <url-pattern>/messageservlet</url-pattern> </web-resource-collection> <auth-constraint> <role-name>AuthorizedUser</role-name> </auth-constraint> <user-data-constraint> <transport-guarantee>NONE</transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <auth-method>BASIC</auth-method> <realm-name>The Restricted Zone</realm-name> </login-config> <security-role> <role-name>AuthorizedUser</role-name> </security-role> <servlet> <servlet-name>messageservlet</servlet-name> <servlet-class>message.MessageServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>messageservlet</servlet-name> <url-pattern>/messageservlet</url-pattern> </servlet-mapping> </web-app>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd"> <jboss-web> <context-root>WebMessage</context-root> <security-domain>java:/jaas/AD</security-domain> </jboss-web>