Hi Les,
After a look through the inheritance hierarchy of
BasicHttpAuthenticationFilter, I could not see anyplace where the
Initializable interface was implemented (though I could easily have
missing it).
To be safe, I changed my subclass to explicitly implement the interface:
public class WaffleNegotiateAuthFilter extends BasicHttpAuthenticationFilter
implements Initializable
{
...
private final NegotiateSecurityFilter negotiateFilter;
public WaffleNegotiateAuthFilter() {
negotiateFilter = new NegotiateSecurityFilter();
}
@Override
protected void onFilterConfigSet() throws Exception {
negotiateFilter.init(getFilterConfig());
}
/**
* Initializes this object.
*
* @throws org.apache.shiro.ShiroException
* if an exception occurs during initialization.
*/
public void init() throws ShiroException {
try {
super.init(getFilterConfig());
} catch (ServletException e) {
throw new ShiroException(e);
}
}
...
I still do not see the init() method being called. Maybe I missed
something else?
I'm using shiro v 1.2.1.
Thanks!
Dan
On 01/11/2013 07:36 PM, [email protected] wrote:
Subject:
Re: AuthenticatingFilter lifecycle when used in [urls]?
From:
Les Hazlewood <[email protected]>
Date:
01/10/2013 10:02 PM
To:
[email protected]
Hi Dan,
If you implement org.apache.shiro.util.Initializable that should be
all that is necessary. init() is called on Initializable instances
after they're fully configured in the [main] section.
However, after looking at some code (briefly), it appears that this
_may_ not occur in all cases. If you see that it does not, can you
please ping us asap? I can get a fix out quickly if so. Also, what
version are you using?
Cheers,
--
Les Hazlewood | @lhazlewood
CTO, Stormpath |http://stormpath.com | @goStormpath | 888.391.5282
Stormpath wins GigaOM Structure Launchpad Award!http://bit.ly/MvZkMk