Slascone.Client
2.1.847
dotnet add package Slascone.Client --version 2.1.847
NuGet\Install-Package Slascone.Client -Version 2.1.847
<PackageReference Include="Slascone.Client" Version="2.1.847" />
<PackageVersion Include="Slascone.Client" Version="2.1.847" />
<PackageReference Include="Slascone.Client" />
paket add Slascone.Client --version 2.1.847
#r "nuget: Slascone.Client, 2.1.847"
#:package Slascone.Client@2.1.847
#addin nuget:?package=Slascone.Client&version=2.1.847
#tool nuget:?package=Slascone.Client&version=2.1.847
Contents
- Overview
- Calling API endpoints
- Convenience features
- Using Slascone Client in your application
- Release notes
For more information about SLASCONE:
https://slascone.com/ and/or https://support.slascone.com/
Slascone.Client
Overview
A NuGet package to access the SLASCONE (OAS 3.0) API.
This package provides a comprehensive .NET Standard 2.0 client for interacting with the SLASCONE software licensing and analytics solution. It streamlines integration with the SLASCONE API by providing methods for managing licenses, devices, and environments.
While direct access of the API via HttpClient is possible, this library significantly reduces complexity through high-level helper functions. These functions go beyond basic API calls, providing high-level utilities that help developers handle digital signature verification, environment detection and device fingerprinting with minimal effort. By leveraging these features, you can ensure secure license validation, adapt to different deployment scenarios (such as cloud or virtual machines), and reliably generate or retrieve unique client identifiers.
Particularly beneficial for use cases that require offline support or operate without network connectivity.
Example applications using the Slascone.Client library on GitHub
You can find example applications using the Slascone.Client library on our Slascone GitHub repository. These samples show how to integrate the client into .NET projects, including WPF and C# console apps, and demonstrate key features such as license activation, heartbeat handling, and offline license support.
- https://github.com/SLASCONE/SLASCONE-demo-wpf-nuget
- https://github.com/SLASCONE/SLASCONE-demo-csharp-nuget
Calling API endpoints
Corresponding to the controllers of the SLASCONE RestAPI, the Slascone.Client library provides a set of interfaces that represent the various API controllers. The Swagger UI, which provides an overview of the controllers and all endpoints, is available at the URL https://api.slascone.com/swagger/index.html?urls.primaryName=V2.
The main entry point is the ISlasconeClientV2
interface,
which exposes a set of strongly-typed API controller clients for all major SLASCONE features, including license management, provisioning, customer and product management, and more.
Administration
The Administration interface provides methods to manage Custom Lists. Um weitere eher ungewöhnliche Verwaltungsaufgaben durchzuführen, rufen Sie die Endpunkte der Administration-Controller direkt z.B. über einen HttpClient auf.
Customer
The Customer interface provides methods to manage customers, including creating, updating, and retrieving customer information and customer users.
DataExchange
The data exchange interface provides methods to manage data exchange operations, such as importing and exporting data related to licenses, customers, and products. You can use this interface to synchronize data between your external systems and the SLASCONE backend, e.g. Customer Relationship Management (CRM) systems or Enterprise Resource Planning (ERP) systems.
DataGathering
The data gathering interface provides methods to manage data gathering operations, such as collecting usage analytics data from your applications.
Product
The Product interface provides methods to manage products, including creating, updating, and retrieving product and product related information, such as features, limitations, and variables as well as software releases.
Template
The Template interface provides methods to manage templates (product editions).
License
The License interface provides methods to manage licenses, including creating, updating, and retrieving license information. It also includes methods for license validation and heartbeat management.
LicenseBundle
The LicenseBundle interface provides methods to manage license bundles, which are collections of licenses of different products that can be assigned to customers or users.
Lookup
The Lookup interface provides methods to manage lookup data, such as license types, product types, and other predefined values used in the SLASCONE platform.
Provisioning
The provisioning interface assembles the main functionality needed in client applications, such as license activation and validation.
Convenience features
Some of the most utilized convenience functions include:
- Digital Signature Verification: Methods like IsFileSignatureValid allow you to verify the authenticity and integrity of license or activation files using asymmetric or symmetric cryptography.
- Offline License Handling: Functions such as GetOfflineLicense enable applications to read and validate license information even when temporarily disconnected from the SLASCONE backend.
- Environment Detection: Utilities in LinuxDeviceInfos and WindowsDeviceInfos help detect if the application is running in a Docker container, virtual machine, or cloud environment by checking for specific files or system properties.
- Unique Client ID Retrieval: The client provides access to various hardware and system identifiers (e.g., machine ID, MAC addresses, DMI product UUID) to generate or retrieve a unique device fingerprint, which is essential for license assignment and tracking.
- System Information Logging: Methods like LogDeviceInfos collect and format detailed device information for diagnostics, support, or analytics purposes.
- HTTP Header Management: The client exposes methods to set, add, or retrieve custom HTTP headers, supporting advanced integration scenarios and user tracking.
These convenience functions are accessible through the ISlasconeClientV2 interface and its platform-specific helpers, making it easy to integrate robust licensing and device management features into your application.
Handling of temporary offline scenarios
License information that is retrieved from the SLASCONE backend is stored in a temporary offline license file. In case the application is not able to connect to the SLASCONE backend, e.g. due to network issues,
the application can use the temporary offline license file to validate the license. The temporary offline license file is stored in the application data folder specified by SetAppDataFolder
.
Signature verification of offline license files
If the license validation is supposed to be done offline, the Slascone.Client library provides methods to verify the digital signature of the license file to ensure its integrity and authenticity.
Using Slascone Client in your application
Instantiation of a Slascone.Client instance
To create an instance of the client, use the SlasconeClientV2Factory
class, which provides static methods to build and configure an ISlasconeClientV2
implementation.
The client supports advanced configuration options such as custom HTTP headers, certificate validation, offline license handling, and more.
string ApiBaseUrl = "https://api.slascone.com";
Guid IsvId = Guid.Parse("2af5fe02-6207-4214-946e-b00ac5309f53");
string ProvisioningKey = "your-provisioning-key";
_slasconeClientV2 =
SlasconeClientV2Factory.BuildClient(ApiBaseUrl, IsvId, ProvisioningKey);
Key components:
- ISlasconeClientV2: The main interface aggregating all API controller clients and configuration methods.
- SlasconeClientV2Factory: Factory class for creating and initializing
ISlasconeClientV2
instances.
Example for creating a license heartbeat:
var heartbeatDto = new AddHeartbeatDto
{
Product_id = Guid.Parse("your-product-id"),
Client_id = clientId,
Token_key = GetTokenKeyFromTemporaryOfflineLicense(),
User_id = _authenticationService.IsSignedIn ? _authenticationService.Email : null,
Software_version = SoftwareVersion,
Operating_system = OperatingSystem
};
var result = await _slasconeClientV2.Provisioning.AddHeartbeatAsync(heartbeatDto);
Configuring Slascone.Client
To configure the Slascone.Client, you need to provide the base URL of the SLASCONE API, your ISV ID, and your provisioning key. These parameters are essential for authenticating requests and ensuring that your application can communicate with the SLASCONE backend.
SetSignatureValidationMode(int signatureValidationMode)
Sets the validation mode for the signature header (none, symmetric, or asymmetric).
SetAppDataFolder(string appDataFolder)
Sets the application data folder for storing license information for offline use. If no application data folder is specified, features like temporary offline license handling will not be available.
SetSignatureCertificate(byte[] rawData)
Sets the certificate (public key) used to verify signatures (asymmetric mode).
SetSignaturePublicKeyXml(string publicKeyXml)
Sets the RSA public key from an XML string for signature verification. The public key can be retrieved in XML format or as PEM file from the SLASCONE licensing portal.
SetSignaturePublicKey(PublicKey publicKey)
Sets the RSA public key directly. The public key can be retrieved in XML format or as PEM file from the SLASCONE licensing portal.
SetProvisioningKey(string provisioningKey)
Sets the provisioning key for authentication. The provisioning API key can be retrieved from the SLASCONE licensing portal.
SetAdminKey(string adminKey)
Sets the admin key for authentication. The admin API key can be retrieved from the SLASCONE licensing portal.
SetBearer(string bearer)
Sets the bearer token for authentication. The bearer token is a JWT token that is provided by an identity provider e.g., Azure AD B2C.
SetLastModifiedByHeader(string lastModifiedById)
Sets the 'LastModifiedBy' HTTP header for requests. The LastModifiedBy content will be noted in the history entries of the SLASCONE backend, allowing you to track who made changes to the data.
SetHttpClientTimeout(TimeSpan timeout)
Sets the HTTP client timeout for API requests. The defaut timeout is 100 seconds. This timeout applies to all HTTP requests made by the client.
SetCheckHttpsCertificate(bool check = true)
Enables or disables HTTPS certificate chain of trust checking.
SetHttpRequestHeader(string headerName, string headerValue)
Sets (adds or replaces) a specific HTTP header for requests.
AddHttpRequestHeader(string headerName, string headerValue)
Adds a specific HTTP header for requests (can add multiple values for the same header).
TryGetHttpRequestHeader(string headerName, out IEnumerable<string> values)
Tries to get the value(s) of a specific HTTP header.
SetTempOfflineLicenseFilenames(string licenseFileName, string signatureFileName)
Sets the filenames for temporary offline license and signature files. By default the filenames are license.json
and license_signature.txt
.
These files are used to store license information for offline use, allowing the application to validate licenses even when not connected to the SLASCONE backend.
The files are stored in the application data folder specified by SetAppDataFolder
.
SetTempOfflineSessionFilename(string sessionFileName)
Sets the filename for the temporary offline session file. By default, the filename is session.token
. The session file is stored in the application data folder specified by SetAppDataFolder
.
Release notes
2.1.847:
- Added value array to analytical heartbeat
- Software shipment: new flag 'is_latest'
2.1.842:
- Offline usage analytics
- Renovate Readme.md; added release notes section and documentation for the Slascone.Client configuration and convenience methods.
2.1.838:
Introduces product controller and start date
- Added product controller
- Added start date
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Win32.Registry (>= 5.0.0)
- Newtonsoft.Json (>= 13.0.3)
- System.Management (>= 9.0.0)
- System.Security.Cryptography.Xml (>= 9.0.0)
- System.Text.Json (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.1.847 | 204 | 6/17/2025 |
2.1.842 | 140 | 6/6/2025 |
2.1.838 | 125 | 5/30/2025 |
2.1.769 | 207 | 4/9/2025 |
2.1.703 | 1,078 | 2/17/2025 |
2.1.695 | 393 | 2/12/2025 |
2.1.686 | 168 | 2/4/2025 |
2.1.682 | 122 | 2/3/2025 |
2.1.573 | 1,044 | 10/22/2024 |
2.1.566 | 184 | 10/4/2024 |
2.1.553 | 141 | 9/24/2024 |
2.1.546 | 151 | 9/16/2024 |
2.1.513 | 445 | 8/6/2024 |
2.1.490 | 150 | 7/22/2024 |
2.1.486 | 136 | 7/17/2024 |
2.1.462 | 189 | 6/18/2024 |
2.1.438 | 140 | 5/28/2024 |
2.1.363 | 741 | 4/10/2024 |
2.1.277 | 421 | 1/16/2024 |
2.1.257 | 248 | 12/14/2023 |
2.1.193 | 2,855 | 10/9/2023 |
2.1.167 | 195 | 9/28/2023 |
2.1.122 | 28,598 | 8/11/2023 |
2.1.118 | 259 | 8/7/2023 |
2.1.111 | 285 | 7/24/2023 |
2.1.92 | 257 | 7/11/2023 |
2.1.72 | 265 | 6/12/2023 |
2.1.70 | 261 | 6/6/2023 |
2.1.60 | 249 | 5/24/2023 |
2.1.58 | 2,323 | 5/23/2023 |
2.1.55 | 252 | 5/17/2023 |
2.1.54 | 247 | 5/16/2023 |
2.0.331 | 262 | 5/15/2023 |
2.0.318 | 4,361 | 4/28/2023 |
2.0.315 | 263 | 4/26/2023 |
2.0.303 | 331 | 4/20/2023 |
2.0.302 | 262 | 4/20/2023 |
2.0.264 | 381 | 3/27/2023 |
2.0.262 | 307 | 3/26/2023 |
2.0.252 | 299 | 3/20/2023 |
2.0.243 | 1,259 | 3/7/2023 |
2.0.218 | 413 | 2/13/2023 |
2.0.211 | 368 | 2/13/2023 |
2.0.204 | 400 | 1/31/2023 |
2.0.203 | 403 | 1/31/2023 |
2.0.202 | 388 | 1/30/2023 |
2.0.176 | 708 | 1/11/2023 |
2.0.167 | 425 | 1/11/2023 |
2.0.164 | 631 | 1/10/2023 |
2.0.158 | 411 | 1/9/2023 |
2.0.140 | 433 | 12/22/2022 |
2.0.139 | 400 | 12/22/2022 |
2.0.116 | 6,882 | 11/10/2022 |
2.0.75 | 698 | 9/27/2022 |
2.0.71 | 566 | 9/21/2022 |
2.0.68 | 533 | 9/20/2022 |
2.0.67 | 557 | 9/20/2022 |
2.0.56 | 552 | 9/13/2022 |
2.0.54 | 575 | 9/13/2022 |
2.0.45 | 639 | 9/12/2022 |