I've found solution for this issue. 

--------------------------------------------------------------- 
class SecurityModule extends ShiroWebModule {

  SecurityModule(ServletContext servletContext) {
    super(servletContext);
  }

  @Override
  protected void configureShiroWeb() {

    bindConstant().annotatedWith(Names.named("loginUrl")).to("/newlogin");
    bindRealm().to(IniRealm.class);
    addFilterChain("/login",
Key.get(ExtendedFormAuthenticationFilter.class));
  }

  @Provides
  @Singleton
  IniRealm loadIniRealm(Ini ini) {
    IniRealm realm = new IniRealm(ini);
    return realm;
  }

  @Provides
  @Singleton
  Ini loadShiroIni() {
    return Ini.fromResourcePath("classpath:shiro.ini");
  }
}

--------------------------------------------------------------- 
public class ExtendedFormAuthenticationFilter extends
FormAuthenticationFilter {

  private final Logger logger = LoggerFactory.getLogger(getClass());

  @Inject
  @Override
  public void setLoginUrl(@Named("loginUrl") String loginUrl) {
    super.setLoginUrl(loginUrl);
  }

  @Override
  protected boolean onLoginFailure(AuthenticationToken token,
AuthenticationException e, ServletRequest request, ServletResponse response)
{
    // some custom logic
  }
} 

--------------------------------------------------------------- 

Regards,
Alex



--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/Guice-integration-configuration-params-injection-does-not-work-tp7580060p7580061.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to