...
The Data Theorem API Protect Java SDK is a Java library that provides protection for APIs written in Java. The SDK integrates with your Java application using the API Protect Servlet Filter which supports most popular Java Web Servers. To Protect an API, all the API developer needs to do is add the API Protect Servlet Filter to their web application code and set the client ID we provide.
Installation
Step 1:
...
Add the
...
Install the apiProtectSdk.jar to your local maven repository
Code Block | ||
---|---|---|
| ||
mvn install:install-file -Dfile=apiProtectSdk.jar -DgroupId=com.datatheorem -DartifactId=apiProtectSdk -Dversion=1.2.3 -Dpackaging=jar |
...
SDK to your Maven/Gradle Configuration File
Example adding dependency to the maven pom.xml
file
Code Block | ||||
---|---|---|---|---|
| <dependencies>
| |||
<repositories> <repository> <id>apiProtectSdk</id> <url>https://api-protect-repos.securetheorem.com/apiprotect-java</url> </repository> </repositories> <dependencies> <!-- ... other deps here ... --> <dependency> <groupId>com.datatheorem</groupId> <artifactId>apiProtectSdk_v3</artifactId> <groupId>com<version>1.2.datatheorem<4</groupId>version> </dependency> </dependencies> |
Add the below to your settings.xml to authenticate the download from the repository:
Code Block | ||
---|---|---|
| ||
<servers> <server> <artifactId>apiProtectSdk<<id>apiProtectSdk</artifactId>id> <username>Maven</username> <version>1.2.3</version> </dependency> </dependencies><password>${env.DATA_THEOREM_REPOS_SERVICE_PASSWORD}</password> </server> </servers> |
Step 2: Add the servlet filter to the application
The servlet filter should be imported and added to your application and added to the filter chain dependin depending on your web framework.
Note: The ordering of filters in the filter chain is important
...