labs64 / netlicensingclient-csharp Goto Github PK
View Code? Open in Web Editor NEWC# wrapper for Labs64 NetLicensing RESTful API
Home Page: https://netlicensing.io
License: Apache License 2.0
C# wrapper for Labs64 NetLicensing RESTful API
Home Page: https://netlicensing.io
License: Apache License 2.0
Goal is to let it work in Visual Studio without adapting it.
The wiki page states that response signature "is currently only implemented in the Java NetLicensing Client library", but issue #16 is closed and there's a bunch of signature-related code in netlicensing-context.cs. At the same time, issue #25 seems to indicate that it doesn't work if you target .NET Framework.
So what is the status?
If it's implemented, the wiki page should be updated. And if it's only working for .NET Core that should be mentioned as well.
I'd like to see this. And run it as a template.ayne use it if it checks out and is a good structure but..Can you please tell me, How do I see it visually besides the folders and content/conde within the folders.
Do I have to copy each folder and ensure it looks the same in my android studio then run an emulator to it or what
Sorry this should be basic knowledge to any user on this site however they don't really walk you through anything. Let alone getting on contact with the developer who posted his code
Thanks for the advise and help
Also am looking to be mentored if that's something that interests you let me know
As I'd love it if the original code writer would want to find turn the script to meet the requirements I need met.
Let me know.
~ EASTinphectiON
The wiki page for Licensee Services states that model-specific validation parameters must be passed with a number suffixed to the parameter name, so that parameters belonging to different modules passed in the same request can be separated. This doesn't work as documented.
I have a PayPerUse module. If I issue a validation request with only that module in the request, and parameters created using ValidationParameters.put(moduleID, "reserveQuantity0", "1")
(in order to reduce the remaining quantity by one), it doesn't work.
But if I create the parameter with put(moduleID, "reserveQuantity", "1")
it does work.
On the Javadoc page for ValidationParameters, put()
is undocumented. It is also uncommented in the C# source.
So is it the case that ValidationParameters.put()
handles the numbering and I should always use the parameter name without numbers?
Or must parameters be numbered only if there is more than one module in the validation request? (There is no mention of that on the Licensee Services page).
Or is it that numbered parameters are not supported for PayPerUse modules (or even just for pre-payment)? Again, there is no mention of any different parameter numbering rules for this licensing model.
Currently, XML Signature tests running on Windows with the error - .NET Framework implementation works differently with the private/public keys.
In the only sample there's, to create a context and authorize, I can only use either basic authentication with my own credentials, or pass the only API key, that has basically the same access.
Now that, obviously, does not work for desktop applications, because that means I would have to ship my API key with the applications, so users would be able to extract it and wreck chaos to my NetLicensing account.
Is there any plan to support NetLicensing for desktop applications?
Would be nice if you had a nuget package.
When I try to validate a licensee without any additional validate parameters (empty ValidationParameters object), just using Licensee Number I get 500 response.
I think it happened because the request Body is empty and ContentType not equal to "application/x-www-form-urlencoded".
Port XML Signature verification from the NetLicensing Java Client.
see commit Labs64/NetLicensingClient-java@8d696e2
Could you add "ttl" parameter to the ValidationResult class?
You are recommending (in your documentation LicenseeServices-Validatelicensee ) to use this parameter on client side to avoid additional load on API server, but the result of validation (ValidationResult class) doesn't contain this parameter.
Thank you.
Hi everyone,
I have try to get all active license based on a licensee number, but i don't seem to reach any data that respect my filter.
I didn't find information about filter in the wiki (https://netlicensing.io/wiki/license-services#licenses-list) or in the Api playground ( https://netlicensing.io/NetLicensing-API/#/).
I have tried some syntax but no result. here what I have tested :
I have tried the same with "active" or with a parameter of the license (requestid) but no change.
I could filter all the license after received them but in case of the number of license receive in the json exceed a limit that could be problematic
Did I miss something in my implementation or in the wiki ?
Add explicite comment on/at (relevant methods and demo samples):
Hi Guys,
I VERY new to Blazor and I was wondering if you could please point me in the correct direction on integrating NetLicensing into a Blazor Application?
This Application has a login per Organization. The Application has Modules. Each Organization will have a license per Module.
What is the correct way of doing it and integrating it into the Blazor Application? I have no idea where to start.
Thanks in advance!
Demo class need to be extended by LICENSEE_SECRET; so this can be showcased as well.
TODOs need to be worked on and resolved, so client library will be up-to-date
e.g.
https://github.com/Labs64/NetLicensingClient-csharp/blob/master/NetLicensingClient/LicenseeService.cs#L135
According to the wiki page for the PayPerUse licensing model, a validation response will contain valid=true
if the sum of quantity
of all active licenses (given credits) is bigger than the sum of usedQuantity
of these licenses (used credits).
In fact, valid=true
is also returned (alongside remainingQuantity=0
) if the numbers are equal.
valid=false
is only returned if (in pre-payment mode) you issue a validation with reserveQuantity=N
and N is greater than the number of remaining credits.
(Note: I have only tried issuing calls with reserveQuantity=1
, and only get valid=false
if there are no credits remaining. I don't know for sure what would happen if there were 10 credits remaining and you asked for 11.)
So if the current behaviour is intended, the documentation needs to be corrected.
But to say that a PayPerUse license is valid when there are no uses left seems a little strange to me.
licenseeSecret is not implemented in the initial validate ?
Throughout the code, there are references to the NetLicensingAPI Javadoc documentation. However, some of these URLs point to http://netlicensing.labs64.com, which isn't working. They should probably be changed to https://go.netlicensing.io.
The paths also need checking. For instance, NetLicensingClient/Entities/Licensee.cs contains the URL
http://netlicensing.labs64.com/javadoc/v2/com/labs64/netlicensing/common/domain/entity/Licensee.html
but the "common" directory seems to have been removed on the netlicensing.io site, so the corresponding URL should be
https://go.netlicensing.io/javadoc/v2/com/labs64/netlicensing/domain/entity/Licensee.html
The following files contain labs64.com URLs:
NetLicensingClient/Entities/BaseEntity.cs
NetLicensingClient/Entities/License.cs
NetLicensingClient/Entities/Licensee.cs
NetLicensingClient/Entities/LicenseTemplate.cs
NetLicensingClient/Entities/netlicensing-context.cs
NetLicensingClient/Entities/PaymentMethod.cs
NetLicensingClient/Entities/Product.cs
NetLicensingClient/Entities/ProductModule.cs
NetLicensingClient/Entities/Token.cs
NetLicensingClient/Entities/Transaction.cs
NetLicensingClient/Entities/ValidationResult.cs
NetLicensingClient/LicenseeService.cs
NetLicensingClient/LicenseService.cs
NetLicensingClient/LicenseTemplateService.cs
NetLicensingClient/NetLicensingClient.xml
NetLicensingClient/PaymentMethodService.cs
NetLicensingClient/ProductModuleService.cs
NetLicensingClient/ProductService.cs
NetLicensingClient/TokenService.cs
NetLicensingClient/TransactionService.cs
If you add NetLicensingClient 2.4.2 to a Windows Forms project targeting .NET Framework or .NET Core, the project breaks completely. Visual Studio lists a number of CS0518 errors, e.g.
"CS0518: Predefined type 'System.Void' is not defined or imported"
mscorlib cannot be added as a reference, because
"This component is already automatically referenced by the build system."
I have noticed that there appear to be two errors reported by NuGet, but it's not clear exactly what it's complaining about.
Here is the output from adding the package to a just-created .NET Framework project. Note the "reference cannot be removed" messages towards the end:
Attempting to gather dependency information for package 'NetLicensingClient-csharp.2.4.2' with respect to project 'WindowsFormsAppFwk1', targeting '.NETFramework,Version=v4.8'
Gathering dependency information took 691 ms
Attempting to resolve dependencies for package 'NetLicensingClient-csharp.2.4.2' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'NetLicensingClient-csharp.2.4.2'
Resolved actions to install package 'NetLicensingClient-csharp.2.4.2'
Adding package 'BouncyCastle.1.8.6.1' to folder '{redacted}\packages'
Added package 'BouncyCastle.1.8.6.1' to folder '{redacted}\packages'
Added package 'BouncyCastle.1.8.6.1' to 'packages.config'
Successfully installed 'BouncyCastle 1.8.6.1' to WindowsFormsAppFwk1
Adding package 'System.Security.Principal.Windows.4.7.0' to folder '{redacted}\packages'
Added package 'System.Security.Principal.Windows.4.7.0' to folder '{redacted}\packages'
Added package 'System.Security.Principal.Windows.4.7.0' to 'packages.config'
Successfully installed 'System.Security.Principal.Windows 4.7.0' to WindowsFormsAppFwk1
Adding package 'System.Security.AccessControl.4.7.0' to folder '{redacted}\packages'
Added package 'System.Security.AccessControl.4.7.0' to folder '{redacted}\packages'
Added package 'System.Security.AccessControl.4.7.0' to 'packages.config'
Successfully installed 'System.Security.AccessControl 4.7.0' to WindowsFormsAppFwk1
Adding package 'System.Security.Permissions.4.7.0' to folder '{redacted}\packages'
Added package 'System.Security.Permissions.4.7.0' to folder '{redacted}\packages'
Added package 'System.Security.Permissions.4.7.0' to 'packages.config'
Successfully installed 'System.Security.Permissions 4.7.0' to WindowsFormsAppFwk1
Adding package 'System.Security.Cryptography.Xml.4.7.0' to folder '{redacted}\packages'
Added package 'System.Security.Cryptography.Xml.4.7.0' to folder '{redacted}\packages'
Added package 'System.Security.Cryptography.Xml.4.7.0' to 'packages.config'
Successfully installed 'System.Security.Cryptography.Xml 4.7.0' to WindowsFormsAppFwk1
Adding package 'NetLicensingClient-csharp.2.4.2' to folder '{redacted}\packages'
Added package 'NetLicensingClient-csharp.2.4.2' to folder '{redacted}\packages'
This reference cannot be removed from the project because it is always referenced by the compiler.
This reference cannot be removed from the project because it is always referenced by the compiler.
Added package 'NetLicensingClient-csharp.2.4.2' to 'packages.config'
Successfully installed 'NetLicensingClient-csharp 2.4.2' to WindowsFormsAppFwk1
Executing nuget actions took 25,54 sec
Time Elapsed: 00:00:26.5739563
========== Finished ==========
NetLicensing C# Client will be aligned with the NetLicesing Clients reference implementation and might cause backward compatibility issues in the vendors' products.
This change needs to announced via version release description.
References:
Constants.REST_API_PATH
Enable "Offline validation using License File or Cache"
reference: https://netlicensing.io/documentation/#usage-scenarios
If you add NetLicensingClient 2.4.2 to a Windows Forms project targeting .NET Core, the project breaks somewhat. The Visual Studio designer is unable to show properties for any forms, components, controls etc. You can still compile, but you can't design your forms in the project that references NetLicensingClient.
When you add the package reference, you get a warning NU1701 concerning BouncyCastle:
Package 'BouncyCastle 1.8.6.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
This makes sense since NetLicensingClient is dependent on BouncyCastle and not BouncyCastle.NetCore. However, as noted in the previous issue, if you try to reference NetLicensingClient in a project that targets .NET Framework all hell breaks loose.
We have implemented NetLicensingClient-csharp the .Net Client library and we are having issues with floating licenses, it is not showing up on the LicenseeService.validate method we get all the subscription licenses, but the floating license is not returned.
According to the licensing model wiki pages, each validation response should include
... in addition to any model-specific attributes.
However, productModuleNumber is missing from the response. The other three are there, but the module identity is not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.