Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hide or customise key not valid message

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
Happs



Joined: 13 Jul 2011
Posts: 62
Location: Sydney, Australia

PostPosted: Tue Mar 17, 2015 4:50 am    Post subject: Hide or customise key not valid message Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Mar 17, 2015 9:24 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Happs



Joined: 13 Jul 2011
Posts: 62
Location: Sydney, Australia

PostPosted: Wed Mar 18, 2015 2:23 am    Post subject: Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Mar 18, 2015 9:26 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group