This sample demonstrates the use of the Sentinel Licensing Web Services interface for the Java programming language.
Java SE 8 (JRE 8 and JDK 8).
Refer to the Sentinel LDK Release Notes - "Supported Platforms for Code Samples" and "Tested Compilers for Code Samples" sections.
This section describes how to compile 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.
To run the samples, run the run_sample script.
The sample consists of several functions. The default flow is as follows:
Log in to a key.
Get key, product, feature, and memory list.
Read memory.
Refresh the session of step 1.
Log out the session of step 1.
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
|
Batch file for building the Java samples. |
| All | configure.properties
|
This file contains the following properties:
The following additional properties are required for OAuth-based authentication:
Modify the properties as required. Save the file using the UTF-8 format. |
| Windows: Mac: Linux: |
run_sample.bat
|
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:
Log in to Sentinel EMS.
From the navigation pane in the vendor portal, select Identities & Access > OAuth Client to view the OAuth Clients page.
Click the Add OAuth Client button.
For Client Type, select Confidential.
For Grant Type, select Client Credentials.
Click Save. The Add OAuth Client page closes, and the OAuth client is added to the list on the OAuth Clients page.
View the Credentials information of the created OAuth client.
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 © 2024 THALES. All rights reserved. Support