Automating a Website Login using Chilkat HTTP
I am trying to write a program that will sign on to a web page. It is a sign on page where I have to enter the user ID and then the password. If is it valid then it goes to the web page.
Do you have any examples like that where I can use?
First, it’s important to understand the difference between HTTP authentication and website login schemes. Chilkat implements various HTTP authentication methods: Basic, Digest, NTLM, and Negotiate. (See http://www.ietf.org/rfc/rfc2617.txt for information about Basic and Digest authentication methods. See http://en.wikipedia.org/wiki/NTLM for information about NTLM.) HTTP authentication methods involve adding HTTP header fields to an HTTP request that provide authentication credentials. Some authentication methods, such as Digest, NTLM, and Negotiate, involve a short back-and-forth handshake to establish authorization parameters in such a way as to avoid sending the actual password over the connection. Chilkat HTTP provides easy-to-use implementations for these authentication methods. It’s just a matter of setting the Http.Login and Http.Password properties, and then letting the component handle it. (The back-and-forth handshake for Digest, NTLM, etc. is handled transparently behind the scenes.)
A website “login” however, is something completely different. A typical scenario is a page that provides an HTML form with fields for submitting a login and password. The information is posted to the server and if valid, the HTTP response contains one or more Set-Cookie header fields containing authorization data. These cookies are then sent with subsequent HTTP requests to provide authentication.
It is not feasible for Chilkat support to analyze the millions of websites in existence which can implement forms-based logins in arbitrary, custom ways (because there is no standard). It is the application programmer’s task to investigate and understand the login process.