Installation
You can learn how to install the Java Enforcer with this article.
The Java Enforcer does not support Java 17+ environments.
Prerequisites
- JDK 1.7 or higher
- If you are using a Java version earlier than 8u161, you may need to install the JCE Unlimited Strength Policy files to enable unlimited strength cryptography. If you don’t do this, you may see
Unlimited Strength Jurisdiction Policyerrors on startup. This is enabled by default in Java version 9 and later. - Your unique HUMAN information:
- Your Application ID. You can find this under Platform Settings > Applications > Overview in the HUMAN console. If you have multiple environments, you will also have multiple Application IDs, so be sure to choose the correct ID for the environment you want to install on.
- Your Server Token. You can find this under Platform Settings > Applications, then selecting an application and navigating to Application settings > Server token.
- Your Risk Cookie Key. You can find this under Bot Defender > Policies > Policy Settings > Policy Information.
Installation
Add the SDK dependency
To add the SDK to your project, add the following dependency to your pom.xml or build.gradle file:
Integrate the Enforcer as a Servlet Filter
Create a filter that intercepts all incoming requests and verifies them with HUMAN. Be sure to include your HUMAN Application ID, Server Token, and Cookie Key.
You only need to include the responseWrapper section found at the end of the code example if you use Credentials Intelligence.
Servlet version >= 3.0
Servlet version < 3.0
Integration example