1

So I'm still getting to grips with Play 2.4 I wanted to use Deadbolt for authentication but it doesn't seem to be resolving any of the deadbolt classes.

In my build.sbt,

libraryDependencies ++= Seq(
javaJdbc,
  cache,
  javaWs,
  "be.objectify" %% "deadbolt-java" % "2.4.4"
)

In my play.plugins,

10000:be.objectify.deadbolt.java.DeadboltPlugin

In my application.conf,

deadbolt.java.handler=security.LoginHandler

The LoginHandler class,

package security;

import be.objectify.deadbolt.java.DeadboltHandler; //does not resolve

public class LoginHandler implements DeadboltHandler {
}

It's not resolving any of the deadbolt packages.

nbz
  • 3,806
  • 3
  • 28
  • 56
  • What do you mean by "does not resolve"? It does not compiles when you start the application? Your IDE is not recognizing the class? – marcospereira Feb 14 '16 at 17:25

1 Answers1

2

It seems the documentation from http://deadbolt.ws/#/java-docs is a bit outdated.

Starting with version 2.4 Deadbolt is using dependency injection (DI) instead of the (deprecated) plugin mechanism of Play. So you don't need the play.plugins file anymore. Check out the release notes for Deadbolt 2.4.

I recommend to follow the Quick start guide instead: https://github.com/schaloner/deadbolt-2-java/blob/master/QuickStart.md It should get you started.

Also have a look at the Deadbolt 2 Java examples: https://github.com/schaloner/deadbolt-2-java-examples - they should be up to date.

mkurz
  • 2,658
  • 1
  • 23
  • 35
  • 1
    I apologize for the documentation - there is a lot of stuff I need to update. I recommend this as the basis for your work: https://leanpub.com/deadbolt-2/read – Steve Chaloner Feb 15 '16 at 07:09
  • @SteveChaloner i was cursing your name and deadbolt's documentation. Then i saw your link. It's really well written, and should, perhaps, be more on display on the website? – bharal Feb 08 '17 at 22:10
  • @bharal thanks for the feedback. I'll make it more prominent. – Steve Chaloner Feb 09 '17 at 08:40