You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gus <gu...@gmx.net> on 2002/09/16 08:42:03 UTC

SecurityFilter and Struts modules

Hi!

I'm trying to use SecurityFilter in a Struts application with modules 
(sub-apps) while the login form is on every page of the whole application.

While in the main app authentication is fine. But when I try to submit 
the j_security_check form in one of the modules I receive the 
following error:
Configuration error: Cannot perform access control without an 
authenticated principal

Does anybody have any hints on that behaviour?

   gus


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityFilter and Struts modules

Posted by Eddie Bush <ek...@swbell.net>.
You can only have one form for conatiner-managed security that submits 
to j_security_check.  You may not go to that form by yourself and login 
-- you must wait for the container to prompt you with it.

There are ways to do what you want to do.  I wrote a secure (in terms of 
it having a security-constraint placed upon it - not talking about SSL) 
redirect action (I'm not talking about the fact it is redirect="true", 
but that it takes a URI to redirect back to) that lets me have a second 
login form.  This second form does not submit to j_security_check, so I 
can have it on "every page".  In addition, I have an action (that the 
form submits to) which takes all request parameters and turns them into 
session-scoped attributes (this was the only way I could get them to the 
CMA-invoked form) which I examine in my other login page that submits to 
j_security_check.

Ok, now, if the session contains a username, I stick it into the CMA 
form.  Same on password.  The last little tidbit is some javascript on 
the CMA page which takes a look at which fields have values and submits 
the form of the appropriate fields have been filled out.  Note:  You 
will have to use some trickery to examine the password, as Opera will 
tell the user that you are (ie script is) attempting to examine their 
password!

Regards,

Eddie

gus wrote:

> Hi!
>
> I'm trying to use SecurityFilter in a Struts application with modules 
> (sub-apps) while the login form is on every page of the whole 
> application.
>
> While in the main app authentication is fine. But when I try to submit 
> the j_security_check form in one of the modules I receive the 
> following error:
> Configuration error: Cannot perform access control without an 
> authenticated principal
>
> Does anybody have any hints on that behaviour?
>
>   gus 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>