0

Suppose you have a database table that contains:

  • serial number
  • machine name
  • domain name/user name
  • IP address
  • date and time

for each time the customer uses (it could be added or updated only) the software you manufacture and sell. How would you prevent more than one user to use it concurrently?

Thanks.

EDIT: I forgot to mention that I am talking about a Desktop application like MS Word.

abenci
  • 8,422
  • 19
  • 69
  • 134
  • 1
    I'm afraid that in its current form the question is far too broad. We would need a lot more specific information about your specific case to be able to provide a narrow enough answer. For instance, what does it mean that your application is "in use" or "used"? Is it a webapi where each request takes a minimal amount of time? Is it a desktop application where you open an application and let it sit open for a long time? Is it a web application where you make requests when the application is opened, and never again until the browser tab is closed? – Lasse V. Karlsen Oct 14 '19 at 09:19
  • 1
    As for "would it work?", have you tried it? Did you test it? I'm pretty sure that even if someone here says "yes, that looks like it should work", the actual situations might differ. For all we know, someone could connect via a cloud server, which changes IP sometimes, would you like to pop up the license then as well? Also, does this mean that if I have a stationary computer at work, and a laptop, I can't run the same license on both? Even if I'm still just one **user**? – Lasse V. Karlsen Oct 14 '19 at 09:21
  • 1
    Basically, this question is too broad precisely because the only way to answer it is to first ask a bunch of questions, getting clarifications, and narrowing it down to your specific usecase. In its current form it covers too many possible scenarios to be useful to anyone, least of all you. – Lasse V. Karlsen Oct 14 '19 at 09:22
  • Too broad? What we want is to limit usage to one concurrent user. I provided all the data we collect at every application execution. What else is missing? – abenci Oct 14 '19 at 09:41
  • OK, if user A starts your application and then user B starts the application, what should happen? Who should have the popup? If user A, does user B have to wait until A releases the license, effectively closing the program on that end? If user B, what now happens to user A, program gets terminated? – Lasse V. Karlsen Oct 14 '19 at 09:49
  • The user B should get a popup that says: _The license belongs to A, do you want to transfer to yourself?_ If you don't allow to transfer licenses instantly you should prevent many users to work with the same license. – abenci Oct 14 '19 at 09:55
  • So then what exactly is the question here? – Lasse V. Karlsen Oct 14 '19 at 10:29
  • What is the best approach to check _single user license_ from the data we collect? I doubt that my first idea was the best, I'm totally new to this topic. – abenci Oct 14 '19 at 10:35
  • Unfortunately, getting ideas on how to do licensing is not within the scope of Stack Overflow. We can help you with the code to do it, but "best approach" is going to be open to opinion, and that is unfortunately off topic here since it fits rather badly with the Q&A format. My best advice would be to find a whiteboard, draw up the current suggestion, and then try your best to poke holes in it with "what if ...", then try to close those holes by adjusting the solution. Basically, try to think like a hacker trying to get access to your application. – Lasse V. Karlsen Oct 14 '19 at 10:41
  • I agree with you only partially. Now the question is very clear. I can remove _my idea_ if you prefer and let other users provide their answers to the question. – abenci Oct 14 '19 at 10:45

0 Answers0