问题
Example:
In shiro.ini I have:
# Change from FormAuthenticationFilter to VerboseFormAuthenticationFilter
authc=webapp.filters.VerboseFormAuthenticationFilter
authc.loginUrl=/login
authc.successUrl=/oncall
How can I perform the above using Shiro Guice? I'm interested in the following line:
authc=webapp.filters.VerboseFormAuthenticationFilter
回答1:
public class YourShiroSecurityModule extends ShiroWebModule {
private static final Key<VerboseFormAuthenticationFilter> VERBOSE_AUTH = Key.get(VerboseFormAuthenticationFilter.class);
public YourShiroSecurityModule(ServletContext servletContext) {
super(servletContext);
}
@Override
protected void configureShiroWeb() {
[...]
addFilterChain("<path>", VERBOSE_AUTH);
}
}
来源:https://stackoverflow.com/questions/10913745/in-shiro-guice-how-can-i-change-authc-to-a-different-subclass