integration of deadbolt with play framework 2.5

151 views Asked by At

image for error after adding "be.objectify" %% "deadbolt-java" % "2.4.3" in built.sbt file in over play project and than in application.conf file adding :

play {
  modules {
    enabled += be.objectify.deadbolt.java.DeadboltModule
  }
} 

and than when i am implementing HandlerCache it says can not resolve HandlerCache. and giving the following error shows in image while running the project.

1

There are 1 answers

0
abhinaya gopalam On

You need to expose your handlers to Deadbolt.Create a module that binds your handler cache and add it in application.conf

Sample new module:

    public class SecurityHook extends Module{

    @Override
    public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
        return seq(bind(DeadboltHandler.class).to(SecurityHandler.class).in(Singleton.class),
                    bind(HandlerCache.class).to(SecurityHandlerCache.class).in(Singleton.class));
    }
}

application.conf:

play.modules {
  enabled += be.objectify.deadbolt.java.DeadboltModule
  enabled += security.SecurityHook
}