Redirect user to a new url but not show them the actual URL.

Last post 05-06-2008 5:09 PM by gunteman. 2 replies.

Sort Posts:

  • Redirect user to a new url but not show them the actual URL.

    05-05-2008, 1:21 AM

    We have a requirement to allow a user to load a large (upto 100 meg word documents for example) document. 

    We have a Enterprise Web Server call DRS (OnDemand) where these documents are stored.  Currently we use a stream to download the content and then send this content to the browser via CGI.  This causes problems when opening large documents, we either a a timeout error or outofmemory error.

     One way around this is to send the user directly to DRS (OnDemand) and view the document, the problem here is that their username and password has to be part of the querystring.

     Is it possible to mask the username and password so we are not sending this information from the client but from the Web Server?

     For Example:

    http://server/app/Viewdoc.aspx?ID=1

    This would translate to

    http://DRSServer/ViewDoc.aspx?ID=1&UID=userid&PWD=password

    Regards

     Paul

  • Re: Redirect user to a new url but not show them the actual URL.

    05-05-2008, 1:42 PM
    • Loading...
    • stiletto
    • Joined on 07-10-2003, 8:42 AM
    • Louisville, KY
    • Posts 3,121

    You could look at UrlRewriting but I'm not sure that would work when you've actually got to pass the url to the browser and change servers.

    Another option might be to "span the streams" by reading a fixed buffer of bytes (256, 128, or whatever size suits you) and passing that from your DRS input stream to the Response.Output stream until you've exhausted your input stream.

  • Re: Redirect user to a new url but not show them the actual URL.

    05-06-2008, 5:09 PM
    • Loading...
    • gunteman
    • Joined on 07-11-2007, 8:57 AM
    • Norrköping, Sweden
    • Posts 1,892

     No, it's not possible to mask a URL. That's an important aspect of general web security.

     Stiletto's stream idea is good and can help a lot. Basically, relay the stream, piece by piece, instead of loading the entire document from the DRS before sending it further.

    Can you make modifications on the DRS server? Can the servers access a shared database (or some other kind of storage)? If so, you could store the information needed for proper authentication (possibly both username and password, but perhaps you won't need that) in a table, together with a freshly baked GUID (Guid.NewGuid()). Send the GUID in the querystring instead of the userid and password, and remove the issued GUIDs from the table after they have been used.

    -- "Mark As Answer" If my reply helped you --
Page 1 of 1 (3 items)