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 

Background Automatic renewal of expiring license

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



Joined: 12 May 2017
Posts: 5

PostPosted: Fri May 12, 2017 3:34 pm    Post subject: Background Automatic renewal of expiring license Reply with quote

Hi again,

Some of our software is designed to run for several weeks at a time, but is also sold on a subscription model run as pay per month.

So we plan to implement ILS using Expiry dates that we will automatically update at our end every time their payment arrives.

Each time the application starts up, it calls GetLicense, which (perfectly!) automatically requests an updated license if it sees that the current one has expired. This will of course pick up the new expiry date from our server and all is well.

The scenario I need to handle though is:

1) Application starts up, license has 2 days left on it's license
2) The customers payment arrives, we update the Expiry date giving them another 30 days
2) Time passes, and now we are at 3 days later, the application has not been restarted, so how do we get the updated expiry date from our server?

Do any of the built in Background checks automatically pull down new Expiry Information, or should we build a timer into our product that fires at (for example) ExpiryDate-1Day (then every 6 hours or so) and calls GetLicense(true,true) to silently force a round trip to the server, or is there another method that we should use?

Another scenario of course is that the customer HASN'T paid, so we haven't extended the expiry date - again, as there are no "expired" events raised by any of the ILS objects, I presume we should be checking that ourselves - and I suppose, given the above scenario, we can then call GetLicense and prompt the user accordingly with a warning that it's nearly expired/ has expired

Thanks for your help,
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 4749

PostPosted: Mon May 15, 2017 11:04 pm    Post subject: Reply with quote

The StartBackgroundReauthentication method starts a background process that will automatically update the license (including the expiry date) if it has been updated. By default this will update the license once per day (24 hours) and continue to do so while the application is running. You can however change the reauthentication interval. If the license has expired then the Background reauthentication will, by default exit the application. If the license has been updated and the expiry date extended then it will just continue to work - so I think it will do exactly what you want.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
PeterJ



Joined: 12 May 2017
Posts: 5

PostPosted: Tue May 16, 2017 4:20 pm    Post subject: Reply with quote

Ok understood.

We'll be using the WPF library, how does the background auth trigger the exit of the application? I suspect we will likely need to intercept that so we can gracefully announce and shutdown
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 4749

PostPosted: Tue May 16, 2017 10:23 pm    Post subject: Reply with quote

By default it calls:

System.Windows.Application.Current.Dispatcher.InvokeShutdown()

and displays an error message. You can change this behaviour by handling the AuthenticatedLicenseProvider.BackgroundReauthenticationFailed event yourself.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
PeterJ



Joined: 12 May 2017
Posts: 5

PostPosted: Thu May 18, 2017 8:59 am    Post subject: Reply with quote

That's great news - thanks for the info - we're off to your store to purchase now then Smile
Back to top
View user's profile Send private message
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