You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Bragg, Casey" <Ca...@allegiancetelecom.com> on 2001/08/28 04:01:48 UTC

How to force authentication from JSP?

Is there a way to force a user to be authenticates as 'Guest' for example?

Running Tomcat 4.0b7.. JDBCRealm...

Is it possible for a JSP (not through javascript) to do something along the
following lines : 

  <jsp:forward page="j_security_check">
      <jsp:param name="j_username" value="<%=p_username%>" />
      <jsp:param name="j_password" value="<%=p_password%>" />
  </jsp:forward>

The above doesn't work... 404 error.. which seems logical since
j_security_check isn't not really a page.  

What I really need this for is where I have a 'Create new user account'
page.  Once the account is created I should have already logged the user in
for convenience.

I know this has been asked before, but I couldn't find the answer in the
archives.

Thanks so much for your help!

...Casey

Re: Regarding j_security_check

Posted by Bernhard Wraase <bw...@netkosmos.de>.
> But has some minor issues. Can anyone tell me some documents where i can
> read
> inside of j_security_check , How exactly it work?

I found no documentation other than the source.


> and where should  i make changes so that it work accoring to my needs.

I just have to modify the JDBCRealm.java.

Good luck Bernhard Wraase



Regarding j_security_check

Posted by Damnish <da...@webrizon.com>.
Hi All,
       I am using tomcat 3.2 .and  using JDBCRealm for authintication, It is
working fine.
But has some minor issues. Can anyone tell me some documents where i can
read
inside of j_security_check , How exactly it work?
and where should  i make changes so that it work accoring to my needs.
Thanks and regards
Damnish



Regarding j_security_check

Posted by Damnish <da...@webrizon.com>.
Hi All,
       I am using tomcat 3.2 .and  using JDBCRealm for authintication, It is
working fine.
But has some minor issues. Can anyone tell me some documents where i can
read
inside of j_security_check , How exactly it work?
and where should  i make changes so that it work accoring to my needs.
Thanks and regards
Damnish



Re: How to force authentication from JSP?

Posted by "Craig R. McClanahan" <cr...@apache.org>.
The only way to pull something like this off is to have the "Create a new
user account" go to some webapp logic that adds new users to the actual
database that JDBCRealm is talking to.  It will be instantly available for
use by the authentication logic.

You still won't be able to have a user create a new account and then be
accepted as already having logged in, though, without writing a custom
Valve implementation that does this for you (and, obviously, is Tomcat
specific).

Craig


On Mon, 27 Aug 2001, Bragg, Casey wrote:

> Date: Mon, 27 Aug 2001 21:01:48 -0500
> From: "Bragg, Casey" <Ca...@allegiancetelecom.com>
> Reply-To: tomcat-dev@jakarta.apache.org
> To: tomcat-dev@jakarta.apache.org
> Subject: How to force authentication from JSP?
>
> Is there a way to force a user to be authenticates as 'Guest' for example?
>
> Running Tomcat 4.0b7.. JDBCRealm...
>
> Is it possible for a JSP (not through javascript) to do something along the
> following lines :
>
>   <jsp:forward page="j_security_check">
>       <jsp:param name="j_username" value="<%=p_username%>" />
>       <jsp:param name="j_password" value="<%=p_password%>" />
>   </jsp:forward>
>
> The above doesn't work... 404 error.. which seems logical since
> j_security_check isn't not really a page.
>
> What I really need this for is where I have a 'Create new user account'
> page.  Once the account is created I should have already logged the user in
> for convenience.
>
> I know this has been asked before, but I couldn't find the answer in the
> archives.
>
> Thanks so much for your help!
>
> ...Casey
>