0

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
Basil Musa
  • 8,198
  • 6
  • 64
  • 63

1 Answers1

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);
    }
}
Thilo-Alexander Ginkel
  • 6,898
  • 10
  • 45
  • 58
  • When I do the above code, the calls bindConstant().annotatedWith(Names.named("shiro.loginUrl").to("/login") does no longer work? As well as all the other variables from the FormAuthenticationFilter (logoutUrl, loginUrl, passwordParam, rememberMeParam, usernameParam). – Basil Musa Jun 07 '12 at 11:17
  • Can you post some code snippet? I am having similar problems with the redirectUrl and am still waiting for a response from the Shiro mailing list... – Thilo-Alexander Ginkel Jun 07 '12 at 20:59