locked
Not Sure If This Is Possible RRS feed

  • Question

  • User-1947031622 posted

    I have page A, and page B. When an outside user comes to page A, I want a module to do a certain security check and if they fail then redirect them someplace else, otherwise send them to their desired destination (page A).

    That is fine, I can see how to use an HTTPModule for that. However, I want to do the same thing when page A tries to access page B. The problem is.... page B is on another server and I can't touch that page. Is there any kind of HTTPModule type thing I can put in place so that when a user clicks a link on page A to go to page B,  it can capture that, do the security check I mentioned, and then send them off to Page B if all is well? (or redirect if not)


    I wanted a module type of thing so I can reuse it across multiple pages easilly... just tack it on.

    Thanks! Any help is greatly appreciated.
     



     

    Wednesday, March 21, 2007 6:17 PM

Answers

  • User-627724879 posted

    Oops

     

    <a href="mysecuritycheck.ashx?desturl=pageb.aspx">Page B</a>

    You would need to URLEncode the full URL.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 21, 2007 9:58 PM

All replies

  • User-627724879 posted

    You might want to create an httpHandler and route the link through the handler, where your security check would be done.

    <a href="mysecuritycheck.ashx">Page B</a>

    Wednesday, March 21, 2007 9:56 PM
  • User-627724879 posted

    Oops

     

    <a href="mysecuritycheck.ashx?desturl=pageb.aspx">Page B</a>

    You would need to URLEncode the full URL.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 21, 2007 9:58 PM
  • User-427396315 posted

    I think this is not secure solution. When user did visit page B, he can remember it and, later he can directly visits it, how can you stop him.

    But if you really want to control user's click on page A to go to page B, you simply add a link button on page A, and hanle when user click on that link.

    Hope this helps. 

    Thursday, March 22, 2007 3:07 AM
  • User-1947031622 posted

    The handler may actually be the way to go for me. However, I want to be able to do two things:

     1. Use the link method where I pass a querystring parameter into the handler .ashx page.

    2. Register pages in the Web.Config file to use this handler as well.

     
    Is this possible? Or can you only register handlers in the web.config file that are compiled DLLs?

    In that case maybe I need to have a DLL handler (for mapping pages to in the web.config), and then have the .ashx page inherit from that handler so that it can be used within links.

     
    Please let me know your thoughts!
     

    Thursday, March 22, 2007 2:39 PM