Question

Assuming I have internet browsers like mozilla and iexplorer, so, I used mozilla and I have already logon to a website using my account username and password logged in, well idhttp can post(submit form, automated click) to the already opened account(without opening the web browser)? OR I will have to used again my username and password to post a submit?

I dont need a code, just asking for answer YES or NO, and if NO! what control in the INDY should I use in my approaced? Sample: I want to automate a submit button for a click(my account is already logged-in)!

thanks

Was it helpful?

Solution

There is no simple YES/NO answer to your question. It depends on how authentication is handled by the web site/server.

By default, http is STATELESS: each call into the server knows nothing about the previous call. In that case, you will have to authenticate EACH TIME you hit the server.

But most modern sites implement some kind of authentication persistence: either by maintaining user session information on the server, or, as Arnaud Bouchez mentioned, sending back a cookie that keeps track of your authentication.

I once wrote a custom web application that sent back an encrypted authentication token with the first response, and it was the client's (it was a custom Windows client with an embedded socket implemented using idhttp, not a browser client) responsibility to send back that token for each subsequent request.

So, your answer is: Let the server handle it - you generally don't have much choice.

OTHER TIPS

I suspect the authentication will be local to the browser, i.e. validated via a browser-specific cookie.

From the Delphi code, you would need to retrieve the cookie (it may be possible, e.g. from a SQLite3 file with FireFox, or as plain text in user profile with IE), then use Indy to query the web site, including the cookie content within the request headers.

But it will highly depend on how the authentication is done. For instance, does it use HTTP or HTTPS protocol? How is implemented the server side?

How about creating a custom browser with a function to auto submit after you login to the site?
I ever make a custom browser with an auto form submit function using TChromium and TBrowser.
It's easy. You just need to know how to control dom using javascript and also manipulating the page source.
Sorry for the simple answer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top