tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <j...@kewlstuff.co.za>
Subject Re: adding authentication to unprotected page
Date Fri, 01 Jun 2007 11:39:34 GMT

You need to read up on Tomcats form based authentication.... I think thats 
what you asking.
Form actually looks like this

<FORM ACTION="j_security_check" METHOD="POST">

<TABLE>

<TR><TD>User name: <INPUT TYPE="TEXT" NAME="j_username">

<TR><TD>Password: <INPUT TYPE="PASSWORD" NAME="j_password">

<TR><TH><INPUT TYPE="SUBMIT" VALUE="Log In">

</TABLE>

</FORM>

but you have to tell tomcat to use it... ie set up all sorts of stuff in the 
Web.xml
Its called Declarative security.

So if some1 tries to access a protected page they get taken to the form... 
log on... and then back to the page.  Your way doesnt work because if you 
have 3 protected pages, which 1 must they go to?

Personally I dont like form authentication....
Another way is to just use standard authentication.... ie the browser will 
prompt the user, and then  present the user with links.

ie the user access the main security page... the browser prompts for 
password... they get in and then just click on one of severl links that 
takes them to other pages.
It sets up in a very similar way in web.xml

Or are you trying to get the user to register... and then redirect them to 
the protected site.
thats different again....

Have fun...



----- Original Message ----- 
From: "Ryan" <niespam@gmail.com>
To: <users@tomcat.apache.org>
Sent: Friday, June 01, 2007 1:09 AM
Subject: adding authentication to unprotected page


> Hi All,
>
> I was wondering if any of you had experience with this. I want to add a 
> form
> on the homepage of an application that allows the user to quickly log in
> (see below) and take them to the protected page. I've never done this 
> before
> and unfortunately the form below doesn't seem to work, it basically brings
> me back to the original page. Any ideas?
>
> Thanks,
> Ryan
>
>
>
>      <form method="POST" action='/package/protected/index.html' >
>      <table>
>        <tr>
>          <td>Username</td>
>          <td><input type="text" class="text" name="j_username" /></td>
>        </tr>
>        <tr>
>          <td>Password</td>
>          <td><input type="password" class="text" name="j_password" /></td>
>        </tr>
>      </table>
>      <p>
>        <input type="submit" class="button" value="Login" />
>      </p>
>      </form>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message