views:

36

answers:

1

Platform: ASP.NET 4.0, VS 2010

My scenario is this

  1. I have the credentials of an external website
  2. I do a couple of GET/POST to scrape some data off of it
  3. Depending on something that I find, I want to give my user a hyperlink that, when clicked, takes him 3 levels deep into the target website beyond the login page

Of course, I could just provide a URL to the top level on the target site, and he would click through to get there. But is there a way, via ASP.NET, that I can programmatically login and then open the page on a separate window/tab?

+1  A: 

I think that, to have the user avoid the login, you're going to have to scrape that page and present it to the user yourself. If you pass the user along to the page at all then he's going to have to authenticate against it. Your application on your server authenticated, but the user in his browser did not. Unless there's some strange (and terribly insecure) quirk about the destination page, it's not going to trust that the user is you.

David
But how would that be useful because I need the user to interact with that page (clicking a button etc.) and go beyond from there...from your answer I gather that I can't really do what I originally intended to
Gerry
@Gerry: That may very well be the case, yes. If the user needs to interact with that site, and assuming that site is using normal authentication tracking (such as cookies), then that user is going to have to authenticate against that site. What you're essentially trying to do is circumvent authentication and act as a man in the middle to intercept the user's authentication. Understandably, authentication mechanisms try to prevent this. It's likely that either the user will need to authenticate or you'll need to build a fully-functional intermediary site as a gateway.
David
OK, that's pretty clear, thanks
Gerry