# Sentinel LDK Licensing WS Sample for Java: Readme

## Overview

This sample demonstrates the use of the Sentinel Licensing Web Services interface for the Java programming language.

## Additional Information

### Prerequisites

Java SE 8 (JRE 8 and JDK 8).

### Supported Operating Systems and Tested Compilers

Refer to the Sentinel LDK Release Notes - "Supported Platforms for Code Samples" and "Tested Compilers for Code Samples" sections.

## Usage Notes

This section describes how to compile the sample.

### Compiling the Sample

Before compiling the samples with `build_sample`, set the JDK environment variable to the path where Java is installed.

For example, for Windows, "set `JDK=p:\java\jdk1.8`".

To compile the samples, run the `build_sample` script.

### Running the Sample

To run the samples, run the `run_sample` script.

## Description of the Sample Flow

The sample consists of several functions. The default flow is as follows:

1. Log in to a key.

2. Get key, product, feature, and memory list.

3. Read memory.

4. Refresh the session of step 1.

5. Log out the session of step 1.

## Components

The Licensing Web Services interface sample contains the following components:

Operating System | Directory or File | Description
--- | --- | ---
All | `lib` | Directory that contains the JAR file used to compile Java package.
All | `src` | Directory that contains the Java sources.
Windows: Mac: Linux: | `build_sample.bat build_sample.sh build_sample.sh` | Batch file for building the Java samples.
All | `configure.properties` | This file contains the following properties: LMS Server address (optional) When this item is not set, you must set the client identity string and append the IP address of the server. For example: clientIdentity=Q3S3XHI:oBWAAQCBEFOP0zXLqZcWUZi6wmFGI7A@192.168.204.175 Transportation protocol (http or https) LMS server port Vendor ID Client identity string (optional) Feature ID for login Login scope of specify key ID or product ID (optional) authType (identity or accesstoken) memoryId offset length keepAliveTimeout (Optional) The following additional properties are required for OAuth-based authentication: Client ID Client Secret AccessTokenUrl userID To determine the values for OAuth properties, see the procedure below. Modify the properties as required. Save the file using the UTF-8 format.
Windows: Mac: Linux: | `run_sample.bat run_sample.sh run_sample.sh` | Batch file for running the activation sample.
All | `MANIFEST.MF` | The manifest file containing information about the other files that are packaged in the archive java-ws-demo.jar.
All | `java-ws-demo.jar` | JAR file with the compiled Java sample package.

To obtain the values for properties when using OAuth-based authentication, you must create an OAuth client in Sentinel EMS.

To create an OAuth client:

1. Log in to Sentinel EMS.

2. From the navigation pane in the vendor portal, select Identities & Access > OAuth Client to view the OAuth Clients page.

3. Click the Add OAuth Client button.

   - For Client Type, select Confidential.

   - For Grant Type, select Client Credentials.

4. Click Save. The Add OAuth Client page closes, and the OAuth client is added to the list on the OAuth Clients page.

5. View the Credentials information of the created OAuth client.

6. Copy Client ID and Client Secret to the configure.properties file.

To obtain the token end point (accessTokenUrl), see https://docs.sentinel.thalesgroup.com/softwareandservices/ems/EMSdocs/UG/idpEndpoints.htm

Copyright © 2026 THALES. All rights reserved. Support

DocID 255 Revision 2406-1