views:

157

answers:

1

We have a series of products with built in web servers each of which has a login page, a customer wants to create a web portal in which they log into once, from there they can simply click on any of the devices (external websites) and it will automatically login to that site and redirect them to the page after the login screen. The portal is using ASP.NET MVC, the external devices are Windows CE based units running embedded web servers. Can find a lot on scraping, but not much on redirection after the event. More Info: Apologies for not being detailed enough, External websites using custom authentication, it's a form fill, which then talks to a custom password engine within the device, uses script to detect if the results are good then redirects the the index page from the login page. Basic username and password entered into form, all of which are set to same on all systems, so can be hard coded, customer does not want password on each device but is forced to by the device software. Cookies not being used. Basically the user is presented with a series of links to all the devices (websites essentially) when they click on the link they want to be taken to the main "index" page rather then have to run though the "login" page.

Update : Have successfully managed to navigate target site and login using HttpWebRequest and HttpWebResponse, so I now have the correct page loaded up in a HttpWebResponse, remaining question is how do I now redirect or open a new browser to display that HttpWebResponse and continue navigating on the logged in target site.

A: 

If you are using basic authentication this will not be possible. As you've seen you are able to perform an HttpWebRequest and pass credentials but this is done server side and you cannot continue navigating. The way it works is that the browser needs to set the credential headers used by basic authentication and this can only be done using the login popup. Some flavors of IE might support the following URL: http://username:[email protected] to provide credentials but not sure would work with other browsers for obvious reasons.

Darin Dimitrov
I understand, server side in "logged in" but no way of passing that control/session to the browser. I will try a JavaScript solution as the user details are not secret, just the login is inconvenient.Thanks for the clarification.
DoodleWalker