C # application for logging in multiple users on one site

Is it possible to make an application that allows us to create an application with 4 web browser controls, and we can independently use each browser control for another login to the same website.

Suppose I have one web browser that works with hotmail with Office Email where, as a second control, a web browser that works with hotmail with personal email

I am currently searching that the web browser cannot have different PROXIES or USER-Agent Strings.

Any solutions?

+4
source share
1 answer

Moving my comments as an answer.

Authentication is tied to an authorization ticket. Find out how the ticket is sent to the service (cookie, url, form) and applies it to your controls.

The URL and auth form should work immediately without any changes - I see that they are used a lot in PHP applications.
Perhaps setting that you do not accept cookies will force this mode - if the service supports automatic switching of the autofile mode (for example, WebForms with cookieless="AutoDetect" ).

Otherwise, try webBrowser.Document.Cookie to change auth cookies - this works out of the box with WinForms.

You need to give the document and add a link to the COM library of Microsoft HTML objects in WPF:

 string cookie = (webBrowser.Document as mshtml.IHTMLDocument2).cookie; 

You can also try to execute web requests manually with the CookieContainer and use the WebBrowser control for visualization only. You should probably read some authentication pages.

Basically you need to send different cookies to different services.

+3
source

Source: https://habr.com/ru/post/1343694/


All Articles