I have to create an application on MVC .Net where in some users can access the application from outside the company but others cannot. the users will be allocated roles and based on that either they are allowed or not allowed to access the web application from outside the company’s network. How can i achieve this.Is there any configuration settings i need to make or put some conditions in Authorize attribute?
Asked
Active
Viewed 40 times
1
-
From what I know it's not possible to detect the Network directly, but you could detect the IP easily: ( https://stackoverflow.com/a/11628125/265165 ). It should be easy enough to retrieve it from `Request.UserHostAddress` using custom Attributes, global handlers etc. Beside that, the question is too broad to deliver a coded example – thmshd Jan 12 '18 at 08:37