So previously I've always developed home windows forms client software while within the work network, we continued the lazy rule that no exterior hardware is permitted on-site, nobody can tamper using the hardware so software was always likely to be run inside the network that have been all became a member of, this permitted me to lazily set the context the following:

WindowsPrincipal wordpress = new WindowsPrincipal(WindowsIdentity.GetCurrent())

Thread.CurrentPrincipal = wordpress

Now I've been requested to create a credit card applicatoin which will probably be running on sales-repetition laptops. I can not 100% guarantee they do not take that software and operate on their house PC and also have it "pretend became a member of" to some network. I understand I'm able to identify what network title they could be became a member of to, but what's the correct method for ensuring the network Is actually OUR network? Can there be some kind of fingerprint I'm able to embed within the application itself for identifying when the network is our work network?

If it's really a fundamental network title check you would like you can easily make use of the identity title (WindowsIdentity.GetCurrent().Title) that ought to contain DOMAINusername. After you have that lots of methods to split the strnig and retrieve the DOMAIN title (see .Internet built-in assistant to parse DomainUsername in User.Identity.Title).

As wegginho pointed out within the comments though someone could theoretically set their network title towards the same network.

Gosh, that is what you meant. Mind meets table during my place. The thing you need is really a License-Server. You are clearly explaining a business license situation! Have you got an MSSQL-Server inside your network?

  • Produce a User much like your_program_nameLCU (license check user)
  • Produce a database in which the user has read access
  • Produce a Try-Catch for that situation once the database isn't accessable
  • Clearly he isn't inside your network so shut lower this program!

Addition to that particular:

It work's perfectly with VPN! And That I guess that is what needed too!