You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by indiancomet <fa...@gmail.com> on 2012/09/24 12:20:42 UTC

Tapestry-Security : Filter settings

Hi,
I am trying to use Shiro via tapestry-security. It has been a hits-n-misses
so far. 
Nevertheless, it has been a good learning experience.
However, I have run into one specific case with filters which i thought
would post here for insight.

When i use the following filter:
<code>
configuration.add(factory.createChain("/**").add(factory.authc()).build());
</code>

I get stuck in a loop on the login form.

However, if i add page specific filters like:
<code>
configuration.add(factory.createChain("/page1").add(factory.authc()).build());
</code>

and then try to access page1, i get the login form. On putting correct login
values i am taken to page1.

Can someone explain this behaviour?




--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-Security-Filter-settings-tp5716466.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry-Security : Filter settings

Posted by indiancomet <fa...@gmail.com>.
Tx Alex and Kalle. This is working as expected now 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-Security-Filter-settings-tp5716466p5716491.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry-Security : Filter settings

Posted by Kalle Korhonen <ka...@gmail.com>.
It's a well known gotcha but nothing we can or plan to do about except
to improve documentation. Also note that the order in which the rules
are contributed is significant.

Kalle


On Mon, Sep 24, 2012 at 9:11 AM, Alex Kotchnev <ak...@gmail.com> wrote:
> The problem w/ the wildcard statement is that when Shiro tries to redirect
> it to the login page, the login page ends up requiring authentication
> (because it matches the /* wildcard pattern), etc. In order to make it do
> what you want, you'll need to allow the login page to be accessed w/o
> authentication (which makes sense) before you declare the filter for /*,
> e.g.
>
> <code>
> configuration.add(factory.createChain("/login").add(factory.anon()).build());
> configuration.add(factory.createChain("/**").add(factory.authc()).build());
> </code>
>
> Cheers,
>
> Alex K
>
> On Mon, Sep 24, 2012 at 6:20 AM, indiancomet <fa...@gmail.com> wrote:
>
>> Hi,
>> I am trying to use Shiro via tapestry-security. It has been a hits-n-misses
>> so far.
>> Nevertheless, it has been a good learning experience.
>> However, I have run into one specific case with filters which i thought
>> would post here for insight.
>>
>> When i use the following filter:
>> <code>
>> configuration.add(factory.createChain("/**").add(factory.authc()).build());
>> </code>
>>
>> I get stuck in a loop on the login form.
>>
>> However, if i add page specific filters like:
>> <code>
>>
>> configuration.add(factory.createChain("/page1").add(factory.authc()).build());
>> </code>
>>
>> and then try to access page1, i get the login form. On putting correct
>> login
>> values i am taken to page1.
>>
>> Can someone explain this behaviour?
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/Tapestry-Security-Filter-settings-tp5716466.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry-Security : Filter settings

Posted by Alex Kotchnev <ak...@gmail.com>.
The problem w/ the wildcard statement is that when Shiro tries to redirect
it to the login page, the login page ends up requiring authentication
(because it matches the /* wildcard pattern), etc. In order to make it do
what you want, you'll need to allow the login page to be accessed w/o
authentication (which makes sense) before you declare the filter for /*,
e.g.

<code>
configuration.add(factory.createChain("/login").add(factory.anon()).build());
configuration.add(factory.createChain("/**").add(factory.authc()).build());
</code>

Cheers,

Alex K

On Mon, Sep 24, 2012 at 6:20 AM, indiancomet <fa...@gmail.com> wrote:

> Hi,
> I am trying to use Shiro via tapestry-security. It has been a hits-n-misses
> so far.
> Nevertheless, it has been a good learning experience.
> However, I have run into one specific case with filters which i thought
> would post here for insight.
>
> When i use the following filter:
> <code>
> configuration.add(factory.createChain("/**").add(factory.authc()).build());
> </code>
>
> I get stuck in a loop on the login form.
>
> However, if i add page specific filters like:
> <code>
>
> configuration.add(factory.createChain("/page1").add(factory.authc()).build());
> </code>
>
> and then try to access page1, i get the login form. On putting correct
> login
> values i am taken to page1.
>
> Can someone explain this behaviour?
>
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Tapestry-Security-Filter-settings-tp5716466.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>