Release notes for v4010
User Account Authentication
Note
You can read more about the way things are set up here. This is just a summary.
We have merged Cryptolens.SKM into Cryptolens.Licensing (former SKGLExtension), so from now on, you just need the Cryptolens.Licensing library to get it to work.
User account authentication allows your customers to authenticate using their accounts instead of license keys, making it easier for them to keep track of their licenses, allowing them to subscribe to new plans, and more. It is also more secure than using license keys.
Assuming that they have associated their account with a customer object in the dashboard (i.e. clicked on the link you sent them), you can access their licenses without explicitly asking for the license key.
string RSAPubKey = "RSA Pub key";
string token = "access token with GetToken permission";
string existingToken = null; // in case you've already authenticated them once and the token is still valid.
var res = UserAccount.GetLicenseKeys(Helpers.GetMachineCode(), token, "TestApp", 5, RSAPubKey, existingToken);
// if they have a license with F1=true and which has not yet expired.
if(res.Licenses.Where(x => x.F1 == true && x.Expires >= DateTime.UtcNow).Count() > 0)
{
Console.WriteLine("Success");
}
else
{
Console.WriteLine("Failure");
}
User account authentication was tested on .NET40, .NET46 and .NET Standard 2.0. In .NET Standard 2.0, Helpers.GetMachineCode()
is not available, so you need to change this to another identifier of the user.