authentication is a real big issue. firstly do you wish to authenticate for security purposes or simply to direct appropriate content.
At its simplest you can just use a username/password combination and then use some validation script on your sever. However, even if you encrypt the password before sending it. It is still hijackable. Therefore you need to use public/private keys.
I provide on one of my applications x509 client certificates to authenticate my end users. That way they need not enter any information see
http://www.urec.cnrs.fr/Distributions/modXLdapAuth/