View previous topic :: View next topic |
Author |
Message |
Happs
Joined: 13 Jul 2011 Posts: 62 Location: Sydney, Australia
|
Posted: Tue Mar 17, 2015 4:50 am Post subject: Hide or customise key not valid message |
|
|
I have override AuthenticateKey() method to validate key and prompt user with our customise message. Its working fine. If the key not valid then our custom message displayed and also Infralution message below, so user see two messages:
"The key 60X2-077A-EE5C-XXXX-46CF-9C96-XXXX-E730 is not valid key for this product"
Is it possible to hide/modify the message above?
Code: |
public override AuthenticatedLicense AuthenticateKey(string authenticationKey)
{
// Extract product information, make sure its valid:
// - If valid then validate the license by: return base.AuthenticateKey(authenticationKey);
// - If not valid then prompt user and return null
if (ValidateProductInfo(authenticationKey))
{
// All conditions met, validate the license
return base.AuthenticateKey(authenticationKey);
}
else
{
// Show customised message about the issue, link to contact us, etc
}
return null;
}
|
Thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Mar 17, 2015 9:24 am Post subject: |
|
|
What exactly are you doing inside the ValidateProductInfo method? Since you have not authenticated the key yet I assume you must be calling the GetProductInfo method passing the AuthenticationKey. This results in an extra trip to the server to get the ProductInfo before it is authenticated
Can you authenticate the license key first to obtain a license, and then just get the ProductInfo from the license. That way if the key is invalid you don't display your error message and just let the default error message display.
If this isn't possible you may need to modify the AuthenticatedLicenseInstallForm to achieve what you want. The OnAuthenticateKeyComplete method is the one that displays error messages if authentication fails for some reason. _________________ Infralution Support |
|
Back to top |
|
|
Happs
Joined: 13 Jul 2011 Posts: 62 Location: Sydney, Australia
|
Posted: Wed Mar 18, 2015 2:23 am Post subject: |
|
|
Thanks for your response.
Quote: | What exactly are you doing inside the ValidateProductInfo method? |
We access the product information by calling "GetProductInfo(key)". Each license key product information contains different value, we need to validate with current product whether its eligible. If not eligible then we don't want to authenticate the key.
Quote: | If this isn't possible you may need to modify the AuthenticatedLicenseInstallForm to achieve what you want. The OnAuthenticateKeyComplete method is the one that displays error messages if authentication fails for some reason. |
It appear we have to modify the AuthenticatedLicenseInstallForm source as the OnAuthenticateKeyComplete is a private method. We do have access to the source code but we prefer not to modify the code where absolutely necessary so we can easily update to latest version. Will think about it, thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Mar 18, 2015 9:26 am Post subject: |
|
|
Yes I think you might need to modify the AuthenticatedLicenseInstallForm source code. Fortunately this is less likely to be affected by changes (and is less complex) then the core AuthenticatedLicenseProvider class. _________________ Infralution Support |
|
Back to top |
|
|
|