Help with jboss and LDAP , java code
frenchi22 Mar 27, 2006 2:15 AMHi Friends, I have developed an application and now need to authenticate using LDAP, my application does not use ejb it is a struts project. I will be accepting an user name and password, i need to authendicate the same. Below are the code that i have added to the
web.xml
<security-constraint> <web-resource-collection> <web-resource-name>Transport</web-resource-name> <description>Require users to authenticate</description> <url-pattern>*.jsp</url-pattern> <http-method>POST</http-method> <http-method>GET</http-method> </web-resource-collection> <auth-constraint> <description>Only allow Authenticated_users role</description> <role-name>Authenticated_users</role-name> </auth-constraint> <user-data-constraint> <description>Encryption is not required for the application in general. </description> <transport-guarantee>NONE</transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/pages/login/login1.jsp</form-login-page> <form-error-page>/pages/login/login_error.jsp</form-error-page> </form-login-config> </login-config>
the code that i have included into the
login1.jsp
<form action="j_security_check" method="post"> Username: <input type="text" name="j_username" ></input> Password: <input type="password" name="j_password" ></input> <input type="submit" value="Submit" /> </form>
the code for
jboss-web.xml
<security-domain>java:/jaas/transport_web_client_security</security-domain>
The code that i included in
login-config.xml
<application-policy name="transport_web_client_security"> <authentication> <login-module code="org.jboss.security.ClientLoginModule" flag="required"/> <login-module code="com.acctp.loginmodule.GenericJbossLoginModule" flag="required"/> </authentication> </application-policy>
These are the changes that i have done but i am not sure what has to go into the
com.acctp.loginmodule.GenericJbossLoginModulefile could anyone help me with this. I would be very much thankful to you.
thanking you in advance,
Sundeep