0

例子:

在 shiro.ini 我有:

# Change from FormAuthenticationFilter to VerboseFormAuthenticationFilter
authc=webapp.filters.VerboseFormAuthenticationFilter
authc.loginUrl=/login
authc.successUrl=/oncall

如何使用 Shiro Guice 执行上述操作?我对以下行感兴趣:

authc=webapp.filters.VerboseFormAuthenticationFilter
4

1 回答 1

0
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);
    }
}
于 2012-06-06T13:43:27.977 回答