3

I am creating a web app which needs licensing logic. For now only a very basic logic is needed:

At time of login check if license file exists

If license file does not exist (first time login) user will be prompted to enter a product key (user will contact me and the product key will be generated by me)

The product key will be decrypted and the decrypted values will be used to generate the license file.

After this each time the user logs in, the license file will be checked if it is valid.

The question I am having is, since it is a web app, where should the license file be generated? Should it be in src/main/resources ? Or should it be directly generated in somewhere like target/classes/ ?

Also it is a Maven Project if that information is required

Thank you

UPDATE: Apologize for the confusion but... The app is built and the war is deployed on a tomcat server on a client's server machine. The question is, very simply put, where should the license file be stored on a web app

user3583252
  • 493
  • 1
  • 5
  • 15
  • Presumably this "license file" is unique to each user, so it should not be anywhere in the artifact *at all* but should be in a (configurable) external location. – chrylis -cautiouslyoptimistic- Sep 09 '18 at 05:21
  • @chrylis yes it is unique for each user as it also checks his/her machine id. External location as in a folder on the user's computer? – user3583252 Sep 09 '18 at 05:23
  • A web app is a server application; hence the license file resides on the server, not on the user's computer. Not clear whether you realize this - you're talking about a location on a user's computer but your application doesn't *run* on the user's computer, it runs on the server. – Erwin Bolwidt Sep 09 '18 at 05:30
  • 1
    @ErwinBolwidt yeah sorry :D I meant to say server computer but typed user's computer by mistake. I wanted to know if the license should be somewhere on the server computer...? – user3583252 Sep 09 '18 at 05:57
  • Since you have confused us with web app vs local app, I suggest being more explicit and detailed about the nature of your app’s architecture. Meanwhile I’m voting to close as unclear. Please make more of an effort in drafting your Question *before* posting. – Basil Bourque Sep 09 '18 at 06:30
  • @GhostCat I'm sure the OP would mention that if that were the case. That's what comments are for. – Erwin Bolwidt Sep 09 '18 at 06:36
  • @BasilBourque Sorry was AFK. Had to go out for a bit. Sorry for the confusion but its a web app and not a local app as I clarified above. The app is built and the war is deployed on a tomcat server on a client's server machine. The question is, very simply put, where should the license file be stored on a web app – user3583252 Sep 09 '18 at 06:46
  • @GhostCat which part of the question is unclear – user3583252 Sep 09 '18 at 06:49
  • 1
    @GhostCat done. And thanks :) – user3583252 Sep 09 '18 at 07:33
  • 1
    Duplicate of: [*save file on server, java web application*](https://stackoverflow.com/q/12014290/642706) and [*Recommended way to save uploaded files in a servlet application*](https://stackoverflow.com/q/18664579/642706) and [*tomcat webapp - where do i store permanent files*](https://stackoverflow.com/q/10194027/642706) and [*where does tomcat store my files?*](https://stackoverflow.com/q/9552058/642706) and [*How to store a file on a server(web container) through a Java EE web application?*](https://stackoverflow.com/q/2663204/642706) – Basil Bourque Sep 09 '18 at 22:16

0 Answers0