[jboss-user] [Security & JAAS/JBoss] - Re: form based authentication not working under JBoss 4.0.5

wonker do-not-reply at jboss.com
Fri Feb 9 06:19:56 EST 2007


Bugger, forgot the confgs, sorry:


  | *** Login.jsp ***
  | 
  | <FORM method="POST" name="j_security_check" action='<%=response.encodeURL("j_security_check") %>'>
  |     <input type="text"     name="j_username">
  |     <input type="password" name="j_password">
  |     <input type="submit"   value="Log In">
  | </FORM>
  | 
  | *** web.xml ***
  | 
  | <security-constraint>
  |     <web-resource-collection>
  |         <web-resource-name>Admin Tool</web-resource-name>
  |         <description>The Admin site</description>
  |         <url-pattern>/action/*</url-pattern>
  |         <http-method>GET</http-method>
  |         <http-method>POST</http-method>
  |         <http-method>PUT</http-method>
  |     </web-resource-collection>
  |     <auth-constraint>
  |         <role-name>Admin System</role-name>
  |     </auth-constraint>
  | </security-constraint>
  | <login-config>
  |     <auth-method>FORM</auth-method>
  |     <realm-name>ADMIN</realm-name>
  |     <form-login-config>
  |         <form-login-page>/Login.jsp</form-login-page>
  |         <form-error-page>/Login.jsp?error=true</form-error-page>
  |     </form-login-config>
  | </login-config>
  | <security-role>
  |     <role-name>Admin System</role-name>
  | </security-role>
  | 
  | *** jboss-web.xml ***
  | 
  | <jboss-web>
  |     <context-root>/admin</context-root>
  |     <security-domain>java:/jaas/admin-profile</security-domain>
  | </jboss-web>
  | 
  | *** login-config.xml ***
  | 
  | <application-policy name="admin-profile">
  |     <authentication>
  |         <login-module code="foo.bar.jaas.spi.LdapLoginModule" flag="required">
  |             <module-option name="noauth">false</module-option>
  |             <module-option name="debug">false</module-option>
  |             <module-option name="principalClass">foo.bar.jaas.AdminPrincipal</module-option>
  |         </login-module>
  |     </authentication>
  | </application-policy>

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013572#4013572

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013572



More information about the jboss-user mailing list