Thanks Piccoli.
Ya Im able to authenticate the user.
 The problem is not in the authentication, it is in the followinng lines of
Code.

String strAuth = request.getHeader("Authorization");
 if (strAuth == null)
 {
     response.setStatus(response.SC_UNAUTHORIZED);
     response.setHeader("WWW-Authenticate", "NTLM");
     return;
 }
If i return a JSP page with status UNAUTHORIZED, then subsequent POST
request will quit working.

//Following are the example code
//Try to execute the code and suggest me if there is any problem
/*Here i have skipped the steps for authentication bcaz the problem is not
in authentication, it is with returning UNAUTHORIZED part of the code.*/

/********************First.JSP*******************/
String strAuth = request.getHeader("Authorization");
 if (strAuth == null)
 {
     response.setStatus(response.SC_UNAUTHORIZED);
     response.setHeader("WWW-Authenticate", "NTLM");
     return;
 }
<html>
<form method="post" name="frm1" action="/main.jsp" target="_self">
   <input type="hidden" name="Username" value="xxxx">
</html>

/************************************Main.Jsp*********************/
<%
    System.out.println("Conten Length  " + request.getContentLength()); //It
will be zero
    String strUsername = request.getParameter("Username"); //It will be
(null)
%>
<html>
<table border="0" width="100%">
  <tr>
    <td width="50%"><p align="center"><b>Usernamme is </b></td>
    <td width="50%"><p align="center"><%=strUsername%></td>
  </tr>
</table>
</html>

Regards
Ganesh


----- Original Message -----
From: "Piccoli, Lucio" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, March 08, 2004 6:11 AM
Subject: RE: RE: NTLM and Post request


> > Im validating the credentials sent by the IE(Step 3 to Step 6).
> > Successfully got the username and domain name.
>
> OK so if I understand you correctly, you are completing step 6 of the
> NTLM authentication and have returned a HTTP 200 back to IE?
>
> > Then I will display a form to user in which his name and domain name
> is
> > filled.
> > user have to fill the remaining entries and submit it.
> > when i try to submit a form, Its data is not received in the
> subsequent
> > pages.
>
> So if I assume that the NTLM auth is complete, then the problem is with
> some HTTP request on your own servlet. I think from your previous mail,
> the HTML is using a HTTP POST? If so are any of the values being sent to
> the servlet? (are you using a servlets ).
>
> Might be better if you post the servlet code here so I can have a look
> OK!
>
> -lp
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> Disclaimer :-   This e-mail message including any attachment may contain
confidential, proprietary or legally privileged information.It should not be
used by who is not the original intended recipient.If you have erroneously
received this message,you are notified that you are strictly prohibited from
using, coping, altering or disclosing the content of this message.Please
delete it immediatly and notify the sender. Newgen Software Technologies Ltd
and / or its subsidiary Companies accept no responsibility for loss or
damage arising from the use of the information transmitted by this email
including damage from virus and further acknowledges that any views
expressed in this message are those of the individual sender and no binding
nature of the message shall be implied or assumed unless the sender does so
expressly with due authority of Newgen Software Technologies Ltd and / or
its subsidiary Companies, as applicable.
>
>
>
>
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to