Authentication
How to use the license system for authentication.
🔐 Creating a simple Auth request
Path Parameters
Name
Type
Description
public static void main(String[] args) throws IOException {
Map<String, String> parameters = new HashMap<>();
parameters.put("token", "12345678910");
parameters.put("checksum", "CHECKSUM_VALUE");
parameters.put("license", "1234-1234-1234-1234");
parameters.put("product", "PRODUCT_NAME");
HttpURLConnection connection = (HttpURLConnection) new URL("http://<IP>:<PORT>>/api/v1/license/auth").openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("User-Agent", "Mozilla/5.0");
connection.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
wr.writeBytes(getParamsString(parameters));
wr.flush();
wr.close();
InputStream stream = connection.getInputStream();
StringBuilder response = new StringBuilder();
new BufferedReader(new InputStreamReader(stream)).lines().forEachOrdered(string -> {response.append(string);});
stream.close();
System.out.println(response.toString()); // Returns a JSON Value
}Last updated