Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any viable alternatives to "classic" cookie authentication?

Is there any way (apart from HTTP authentication, which I gather is inherently insecure over the Internet?) for a "real life" website to handle logins and authentication rather than the traditional way, using session cookies?

like image 840
Jonathan Ford Avatar asked Apr 03 '09 17:04

Jonathan Ford


2 Answers

HTTP digest authentication (which is quite a different beast from HTTP basic authentication) is quite secure over straight HTTP, and not at all difficult to implement on the server. Nothing is sent over the wire that could reveal what the password is, just information that allows the client to demonstrate to the server that they have the correct password.

If you want a decent explanation of how to implement HTTP digest authentication in your application, Paul James has an excellent article on it.

The only real problem with HTTP authentication is in the browsers themselves: the UI is terrible, but that can be overcome with some Javascript.

Addendum: This answer is almost a decade old. These days, you should really be using HTTPS regardless of any other considerations.

like image 131
Keith Gaughan Avatar answered Oct 13 '22 00:10

Keith Gaughan


HTTP basic authentication is perfectly safe when used with a SSL (https://) website since all HTTP traffic including the credentials will be encrypted. One subjective drawback though is when using this method your users will need to interact with their browser's authentication popup in order to log in to your site.

like image 21
Adam Alexander Avatar answered Oct 12 '22 22:10

Adam Alexander