-2

Can any of you help to resolve the below issue related to security purpose which need to developed in ASP.NET MVC4

I need to capture the Domain name of client website when they request to my website pro grammatically.

Basically my website is developed for specific user only and they domain name already got save in Data Base so i need to give authentication to those domain only which got save in my DB.

I have tried various combination of code which is not working for me like

Request.url
Request.host
Request.absolutepath
Request.servervariable

They all gives me current request domain name which is my domain name, so please help me out to get resolved this issue

Thanks in advance!

Divyang Desai
  • 7,483
  • 13
  • 50
  • 76
touseef
  • 3
  • 4

1 Answers1

1

I think you are looking for HttpRequest.UrlReferrer

Beware that there a methods to spoof the URL referrer!

So if the IP address of the caller who is allowed access is fixed, it might be better to configure IIS to only accept requests from this IP. IIS 8.0 Dynamic IP Address Restrictions

Community
  • 1
  • 1
Georg Patscheider
  • 9,357
  • 1
  • 26
  • 36