shiro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Narcom <narcom_b...@yahoo.com>
Subject Re: Adding new custom filter to [filters] in ShiroFilter
Date Fri, 18 Dec 2009 22:30:20 GMT

Thank you for quick reply. 
I have been starting to think that the only way to add filter to modify
DefaultFilterChainManager... 

I use project with Spring remote invocationwith native sessions. I just
copied UserFilter to MyUserFilter and use it. And one thing is very strange
for me. If I configure url like this:
/remoting/secure/**=myFilter
and try to call my secure method(protected with role annotation). filter do
not allow me to do it due to subject.getPrincipal() returns null. and as
result request is failed

but... if I do the same call with this url configuration:
/remoting/secure/**=myFilter, perms[remote:invoke]
then request is successfully processed. and in this case filter's method
isAccessAllowed even does not called at all.

could you please describe this logic. it looks like it is not possible to
use filters when you use spring remote invocation?


Les Hazlewood-2 wrote:
> 
> Hi Narcom,
> 
> Here ya go (I'll be updating this in the documentation soon):
> 
> [filters]
> ...
> 
> # Create an object that is injected into by 'myFilter' below
> aDependency = some.pkg.MyClass
> aDependency.fooProperty = someValue
> 
> myFilter = com.company.pkg.MyCustomFilter
> myFilter.barProperty = anotherValue
> myFilter.dependency = $aDependency
> ...
> 
> [urls]
> ...
> /some/path/** = myFilter, authc, ...
> ...
> 
> 
> You can also configure the SecurityManager and any of its dependencies
> the same way in the main section:
> 
> [main]
> securityManager.property = value
> securityManager.dependency = $anotherDependency
> 
> etc.
> 
> HTH,
> 
> Les
> 
> On Fri, Dec 18, 2009 at 1:51 PM, Narcom <narcom_baku@yahoo.com> wrote:
>>
>> I try to add new custom filter (similar to UserFilter) to [filters] in
>> ShiroFilter in web.xml
>> but I cannot figure how to do it? Could some help me with it?
>> --
>> View this message in context:
>> http://n2.nabble.com/Adding-new-custom-filter-to-filters-in-ShiroFilter-tp4188224p4188224.html
>> Sent from the Shiro User mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://n2.nabble.com/Adding-new-custom-filter-to-filters-in-ShiroFilter-tp4188224p4189261.html
Sent from the Shiro User mailing list archive at Nabble.com.

Mime
View raw message