You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "anton.litvinenko" <an...@gmail.com> on 2010/11/24 12:11:46 UTC

T5.1 and Tynamo Security: override a Shiro Filter

Hello!

I need to override Shiro authc filter. I can do that via shiro.ini file: 
[main]
authc=com.programeter.web.security.RemoteUserAuhtenticationFilter

But I am wondering if there's way to achieve the same via XxxModule and
configure Shiro via Tynamo Security. Tynamo has a SecurityRequestFilter
class, but it seems that section that could help me is commented out:

/*
        //Apply the acquired and/or configured filters:
        Map<String, Filter> filters = getFilters();
        if (!CollectionUtils.isEmpty(filters)) {
            for (Map.Entry<String, Filter> entry : filters.entrySet()) {
                String name = entry.getKey();
                Filter filter = entry.getValue();
                applyGlobalPropertiesIfNecessary(filter);
                if (filter instanceof Nameable) {
                    ((Nameable) filter).setName(name);
                }
                //'init' argument is false, since Spring-configured filters
should be initialized
                //in Spring (i.e. 'init-method=blah') or implement
InitializingBean:
                manager.addFilter(name, filter, false);
            }
        }
*/

Am I missing something? Or it is by design not permitted to override (or add
custom) filters via Tapestry IOC? 

-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/T5-1-and-Tynamo-Security-override-a-Shiro-Filter-tp5769989p5769989.html
Sent from the Tapestry Users 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: T5.1 and Tynamo Security: override a Shiro Filter

Posted by "anton.litvinenko" <an...@gmail.com>.
Damn, I only now find out that I have replies to my question.

Kalle, I have an app that sometimes (depending on some conf init parameter)
should use the typical login "inapp" sequence (tapestry login page and out
of the box tapestry-shiro integration) but at other times the authentication
should be handled by apache that proxies jee container and auth info is
passed as XX header.

So in one case I don't need any conf file at all and in the second i need a
shiro.ini file to overrride default authc filter and also to mark number of
URLs to be accessible by anonymous users:

[main]
authc=com.programeter.web.filters.RemoteUserAuhtenticationFilter

[urls]
/assets/**=anon
/register*=anon
/register/**=anon
/unauthorized*=anon
/unauthorized/**=anon
/changepassword*=anon
/changepassword/**=anon
/remindpassword*=anon
/remindpassword/**=anon
/**=authc

Kalle, thanks for raising this in Jira -> will vote and follow it!

--
View this message in context: http://tapestry-users.832.n2.nabble.com/T5-1-and-Tynamo-Security-override-a-Shiro-Filter-tp5769989p6191642.html
Sent from the Tapestry Users 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: T5.1 and Tynamo Security: override a Shiro Filter

Posted by Kalle Korhonen <ka...@gmail.com>.
Follow http://jira.codehaus.org/browse/TYNAMO-67. In the one
application I needed this, I'm still using tapestry-security 0.1.0
which allowed these type of contributions and was a separate and my
original effort at integrating jsecurity/shiro. There were a few other
interesting features and I'll merge them in over time, but don't hold
your breath. Out of interest, what's your use case for it? (If it's
just the dislike of the configuration file, that's fine I get it).

Kalle


On Thu, Nov 25, 2010 at 10:06 AM, Kalle Korhonen
<ka...@gmail.com> wrote:
> Whoops. We certainly wanted to make overriding possible
> programmatically. I'm on it, didn't look into the code yet but if it
> doesn't currently work I'll definitely fix it. Which version of
> tapestry-security are you using?
>
> Kalle
>
> On Wed, Nov 24, 2010 at 3:11 AM, anton.litvinenko
> <an...@gmail.com> wrote:
>>
>> Hello!
>>
>> I need to override Shiro authc filter. I can do that via shiro.ini file:
>> [main]
>> authc=com.programeter.web.security.RemoteUserAuhtenticationFilter
>>
>> But I am wondering if there's way to achieve the same via XxxModule and
>> configure Shiro via Tynamo Security. Tynamo has a SecurityRequestFilter
>> class, but it seems that section that could help me is commented out:
>>
>> /*
>>        //Apply the acquired and/or configured filters:
>>        Map<String, Filter> filters = getFilters();
>>        if (!CollectionUtils.isEmpty(filters)) {
>>            for (Map.Entry<String, Filter> entry : filters.entrySet()) {
>>                String name = entry.getKey();
>>                Filter filter = entry.getValue();
>>                applyGlobalPropertiesIfNecessary(filter);
>>                if (filter instanceof Nameable) {
>>                    ((Nameable) filter).setName(name);
>>                }
>>                //'init' argument is false, since Spring-configured filters
>> should be initialized
>>                //in Spring (i.e. 'init-method=blah') or implement
>> InitializingBean:
>>                manager.addFilter(name, filter, false);
>>            }
>>        }
>> */
>>
>> Am I missing something? Or it is by design not permitted to override (or add
>> custom) filters via Tapestry IOC?
>>
>> --
>> View this message in context: http://tapestry-users.832.n2.nabble.com/T5-1-and-Tynamo-Security-override-a-Shiro-Filter-tp5769989p5769989.html
>> Sent from the Tapestry Users 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: T5.1 and Tynamo Security: override a Shiro Filter

Posted by Kalle Korhonen <ka...@gmail.com>.
Whoops. We certainly wanted to make overriding possible
programmatically. I'm on it, didn't look into the code yet but if it
doesn't currently work I'll definitely fix it. Which version of
tapestry-security are you using?

Kalle

On Wed, Nov 24, 2010 at 3:11 AM, anton.litvinenko
<an...@gmail.com> wrote:
>
> Hello!
>
> I need to override Shiro authc filter. I can do that via shiro.ini file:
> [main]
> authc=com.programeter.web.security.RemoteUserAuhtenticationFilter
>
> But I am wondering if there's way to achieve the same via XxxModule and
> configure Shiro via Tynamo Security. Tynamo has a SecurityRequestFilter
> class, but it seems that section that could help me is commented out:
>
> /*
>        //Apply the acquired and/or configured filters:
>        Map<String, Filter> filters = getFilters();
>        if (!CollectionUtils.isEmpty(filters)) {
>            for (Map.Entry<String, Filter> entry : filters.entrySet()) {
>                String name = entry.getKey();
>                Filter filter = entry.getValue();
>                applyGlobalPropertiesIfNecessary(filter);
>                if (filter instanceof Nameable) {
>                    ((Nameable) filter).setName(name);
>                }
>                //'init' argument is false, since Spring-configured filters
> should be initialized
>                //in Spring (i.e. 'init-method=blah') or implement
> InitializingBean:
>                manager.addFilter(name, filter, false);
>            }
>        }
> */
>
> Am I missing something? Or it is by design not permitted to override (or add
> custom) filters via Tapestry IOC?
>
> --
> View this message in context: http://tapestry-users.832.n2.nabble.com/T5-1-and-Tynamo-Security-override-a-Shiro-Filter-tp5769989p5769989.html
> Sent from the Tapestry Users 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