[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 501
  • Last Modified:

How to insure a Web Request is Valid

I have two ASP.net  websites ( call them A and B)
Website A will use class WebHTTPRequest to obtain a page from Website B

When pagetoget.aspx  on  Website B runs how can I insure the request is coming
from Website A?

I can know the IP address and Machine name of Website A. Does this help?
I am assuming someone can grab website A code and modify it and put it on a different machine
and do whatever to fool Website B.

Any help/ideas will be appreciated.
Thanks









0
jimr111998
Asked:
jimr111998
  • 2
  • 2
2 Solutions
 
Aaron TomoskyTechnology ConsultantCommented:
You can check the headers for referrer, but it's easier just to use the iis built in ip filter on website b. I know it's included on iis7 and up, not sure about earlier versions.
0
 
jimr111998Author Commented:
aarontomosky:
I really don't want a solution that depends on configuring a server.
Thanks
0
 
Aaron TomoskyTechnology ConsultantCommented:
Ok, then check the referrer in the headers. If it's not site a then redirect to an error page
0
 
Alfred A.Commented:
You could try using Request.UrlReferrer to check if page is being accessed by another site.

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Page.Request.UrlReferrer != null)
            {
                string sUrl = Page.Request.UrlReferrer.ToString();
                //Redirect from another page
            }
            else
            {
                //Not redirect from another page.  It is either being accessed directly.
            }
        }
       
    }
0
 
jimr111998Author Commented:
I am not sure that this method of just checking the
referrer address is sufficient.  I've heard of IP spoofing.
I wonder if someone  who new the TCP/IP  protocol
well enough could  construct a TCP/IP message with
the desired  IP source  inserted.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now