Hi Andy,

Yep, you can do this, but you'll need to use the
PassThruAuthenticationFilter instead to 'pass thru' the request to
your login controller directly.  The 'authc' filter defaults to an
instance of the
org.apache.shiro.web.filter.authc.FormAuthenticationFilter class and
is used only if you want Shiro to be the 'controller' for form
submissions.  This works fine in many apps, but for more customized
processing, you'll definitely want to use the
PassThruAuthenticationFilter instead.

You have two ways to do this.  In your ShiroFilter's .ini config, you
can 1) reassign the 'authc' filter to be what you want:

[filters]
...
authc = org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter

or you can 2) just create a new filter and reference that everywhere
instead of 'authc':

myAuthc = org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter

[urls]
/some/path = myAuthc
etc.

I tend to prefer the first to avoid the confusion that there might be
more than one authentication filter, but it is entirely up to you.

Cheers,

Les

On Mon, Jul 27, 2009 at 4:00 PM, Andy Tripp<[email protected]> wrote:
> Hi,
> I have a question about filters.
> In the javadoc for the ShiroFilter class, it shows how to redirect all
> requests to urls under "/account" to the built-in "authc" filter. I've
> got that working in the "webapp" example, and I've changed the login.jsp
> to invoke my servlet that does the authentication.
>
> But now, of couse, I want to pass the user on to the page he was trying
> to get to (e.g. /account/index.jsp). Is there a way to do that? Perhaps
> a way in the filter configuration text that says "redirect all
> /account/** requests to login.jsp, and set the hidden form field called
> 'nextPage' to the specific URL that the user's trying to get to" or
> something like that?
>
> Thanks,
> Andy
>

Reply via email to