...
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
...
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://repos.securetheorem.com/api_protect_sdks/apiprotect-java</url> </repository> </repositories> <dependencies> <!-- ... other deps here ... --> <dependency> <groupId>com.datatheorem</groupId> <artifactId>apiProtectSdk</artifactId> <systemPath>{PROJECT_DIR}/{PATH_TO_SDK}/apiProtectSdk.jar</systemPath> <version>1.0-SNAPSHOT</version> <scope>system</scope> </dependency> </dependencies> <artifactId>apiProtectSdk_v3</artifactId> <version>1.2.4</version> </dependency> </dependencies> |
Add the below to your settings.xml to authenticate the download from the repository:
Code Block | ||
---|---|---|
| ||
<servers>
<server>
<id>apiProtectSdk</id>
<username>Maven</username>
<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
...