Hi Paul,

Thanks for asking this question - I just realized that although I
cover INI configuration in the main configuration page, the
web-specific stuff needs to be updated in the 'Web' configuration
section.

The enum is for Shiro's use only - it makes it easy for the Shiro
developers to keep track of the default filters that we have and what
name they are keyed under.  You shouldn't modify this Enum - all
end-user Filter definitions/configuration can be done in the INI
config or whatever other config mechanism you're using.  If you're
using INI, after your [main] section, just add a

[filters]

section and configure one or more filters the same way you'd configure
any other object in [main].

Those filter instances will be available to you in the

[urls]

section, which is where you define your filter chains.  You can use
any of the pre-defined filters (named the same as in the DefaultFilter
enum), or define your own.

If you want your own filter to perform easy per-path configuration,
you should extend the Shiro PathMatchingFilter class, since that has
the built-in ability to have different configuration based on URL
pattern.

However, I just created SHIRO-153:
https://issues.apache.org/jira/browse/SHIRO-153

due to a problem with the [filters] section - it will be removed for
1.0, so be prepared to just move your filter definitions (not the
urls) into the [main] section after 1.0

Does this help?

- Les

On Sun, Apr 25, 2010 at 8:43 AM, Paul Merlin <[email protected]> wrote:
> Hi folks,
>
> I'm exploring shiro code to see how to add a custom AuthenticationFilter but 
> it
> seems that thoses that are available in configuration (authcBasic etc...) are
> defined in the enum DefaultFilterChainManager.DefaultFilterChainManager.
>
> How could I add another one writen by me ?
>        1. Programmaticaly ?
>        2. By configuration ?
>
> Thanks in advance
>
> /Paul
>
>
>

Reply via email to