Java, Spring Boot and Vue
Install the Spring Boot starter and connect ContentEntitlement to your existing user and content repository. Add Vue only if your frontend uses it.
Preview SDK, application example and source. Keep the extracted folder layout.
All platforms and complete kit · Understand the integration process
The three places you customize#
- Configure
application.properties / server environmentSet DRMX_SITE_ID, DRMX_SITE_KEY, DRMX_ACCESS_KEY and the instance ID.
- Authorize
DrmxAccess.java and your repository
Implement ContentEntitlement with current user/video permission checks.
- Route
PlayerController.java / your controller
Use the same authorized lookup for page metadata and session requests.
1. Install the bundled JAR#
Use Java 21 and Maven. From the extracted kit root:
mvn install:install-file -Dfile=packages/maven/drmx-spring-boot-starter-1.3.0-preview.13.jar -DpomFile=packages/maven/drmx-spring-boot-starter-1.3.0-preview.13.pomThe example uses Spring Boot 3.5. In an existing application, add the starter dependency shown in examples/sdk/java/pom.xml. Maven may download its ordinary framework dependencies.
2. Play one video locally#
In examples/sdk/java/src/main/java/com/haihaisoft/drmx/LocalDemo.java, replace your-published-content-id. Set the three credentials and DRMX_DEMO_PASSWORD to a local test password of at least 12 characters.
cd examples/sdk/java
mvn spring-boot:run -Dspring-boot.run.profiles=local-demoOpen http://127.0.0.1:8107/. Sign in as drmx-learner; drmx-denied provides a denied test account. The temporary in-memory database resets on restart. It is demonstration application code, not a required production schema.
3. Connect your real database#
Implement the bean in DrmxAccess.java. Your repository performs the lookup and permission check; the following is an illustrative replacement:
@Bean
ContentEntitlement contentEntitlement(CustomerCatalog catalog) {
return (userId, videoId) -> catalog.findAuthorizedVideo(userId, videoId)
.map(video -> new AuthorizedVideo(
video.drmxContentId(), video.contentType(), video.policy()));
}Return Optional.empty() for denied access. Connect PlayerController to the same repository and preserve the exact requested content/type comparison. Keep normal Spring Security and CSRF protection. The example controller uses numeric website IDs; adapt its parameter and repository together if your application uses UUIDs.
4. Connect your frontend#
The example’s HTML page demonstrates the shared Web Component. If you use Vue, use integrations/web-components/DrmxPlayer.vue and the adjacent runtime files. Pass authorized content metadata and the same-origin session URL from your controller. Disable the local-demo profile in production.
Check before going live#
- Sign in as an allowed user and play a published video in a supported browser.
- Try signed-out and unpaid users, then revoke or expire access. New session requests must be denied.
- Change the browser Content ID or website video ID. The server must check the new selection.
- Set the exact public HTTPS origin, keep your framework’s session/CSRF protection, and disable demo identity code.
Existing sessions and DRM licenses have their own lifetimes. Permission changes are checked on new requests; they do not erase a license already issued.
DRM-X 6.0