Deadbolt for Java

The Deadbolt for Java Developer Hub

Welcome to the Deadbolt for Java developer hub. You'll find comprehensive guides and documentation to help you start working with Deadbolt for Java as quickly as possible, as well as support if you get stuck. Let's jump right in!

This project is supported by Auth0.

If you want to easily add secure authentication and authorization to your Java or Scala projects, feel free to check out Auth0's Java SDK, Scala examples and free plan at

Get Started    
Ask A Question


Designing Resource Owner Check

Posted by Rishabh Joshi about a year ago


I would like to create a custom/dynamic constraint where I would check if the resource is owned by the current Subject.
Currently, I am solving this by retrieving the requested resource and checking against the created_by field. If it matches, the custom constraint returns true, else false.

Now, my problem is that I want to return a 404, instead of 403 (which would be returned by default as the method would return false.), if the resource is not found.

How can I design my constraint to do that?


Loading comments...