[jboss-user] [Security & JAAS/JBoss] - Re: combination of JAAS

zilbi do-not-reply at jboss.com
Mon Mar 24 04:48:43 EDT 2008


it works!!!

thanks man,

got rid of the bloody j_security_check, replaced it with my own servlet like you said, and suddenly all is ok.

my web.xml did not change at all, my login.jsp:
<form name="logonForm" action="<%=request.getContextPath()%>/LoginServlet" method="post">
  |             <table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="white">
  |                 <tr align="center">
  |                     <td align="right" class="Prompt"></TD>
  |                     <td align="left">
  |                         <input type="text" name="user" maxlength=20>
  |                     </td>
  |                 </tr>
  |                 <tr align="center">
  |                     <td align="right" class="Prompt"> </TD>
  |                     <td align="left">
  |                         <input type="password" name="pass" maxlength=20 >
  |                     </td>
  |                 </tr>
  |                 <tr align="center">
  |                     <td align="right" class="Prompt"> </TD>
  |                     <td align="left">
  |                         <input type="submit" value="Login">
  |                     </td>
  |                 </tr>
  |             </table>
  |         </form>

and my servlet doPost:

  | // Get the form's username & password fields
  | String userName = req.getParameter("user");
  | String pass = req.getParameter("pass");
  | 		    
  | WebAuthentication webA = new WebAuthentication();  
  | boolean loginFlag = webA.login(userName, pass);  
  | 		   
  | if (loginFlag)
  | {
  |     User user = userDao.findByUserName( req.getUserPrincipal().getName() );
  |     // do some things with the user...
  | 			    
  |     String redirectUrl = req.getHeader("Referer");
  | 			    
  |     if (redirectUrl != null)
  |     {
  |     	res.sendRedirect( redirectUrl );
  |     }
  | }
  | else
  | {
  |   	res.sendRedirect( "error.jsp" );
  | }
  | 

still i do not understand why it does not work with j_security_check? is this a bug?
how come the j_security_check does not 'recognize' what the WebAuthentication is doing?
well, got it around it so i guess i can live with that...

thanks again to everyone...
Zilbi

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

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



More information about the jboss-user mailing list