So I'm revamping two websites that require user registration and login and I've been reading a bit about OpenID and OAuth as these systems are used by most of the big guys like google and twitter. and I am thinking that they are pretty elaborate systems intended to delegate access to one's Web Application to other clients/web applications / whatever without requiring users to re-enter all their details. OpenID's description on Wikipedia says:
OpenID (OID) is an open standard and decentralized protocol by the non-profit OpenID Foundation that allows users to be authenticated by certain co-operating sites (known as Relying Parties or RP) using a third party service. This eliminates the need for webmasters to provide their own ad hoc systems and allowing users to consolidate their digital identities. In other words, users can log into multiple unrelated websites without having to register with their information over and over again
OAuth's entry says:
OAuth is an open standard to authorization. OAuth provides client applications a 'secure delegated access' to server resources on behalf of a resource owner. It specifies a process for resource owners to authorize third-party access to their server resources without sharing their credentials. Designed specifically to work with Hypertext Transfer Protocol (HTTP), OAuth essentially allows access tokens to be issued to third-party clients by an authorization server, with the approval of the resource owner, or end-user. The client then uses the access token to access the protected resources hosted by the resource server. OAuth is commonly used as a way for web surfers to log into third party web sites using their Google, Facebook or Twitter accounts, without worrying about their access credentials being compromised.
All this talk about third-party access and unrelated websites makes me think that these authentication protocols are either overkill or just poorly suited to the websites/applications that I'm working on. On the other hand, I feel like these are very good things to know about and we might also be positioning our web apps as some kind of API in the future.
The more I read, the more these technologies seem like a way for the big companies (Google, Twitter, etc.) to track what you use your ID for. For that reason, I dislike the idea of allowing users to use their Google/Twitter/Other accounts to connect to my site as it seems like privacy is compromised. Conversely, it seems unlikely that I need to go through the trouble of establishing some elaborate OAuth or OpenID scheme with my app at the center because I'm not a big player such that people would want to use my account to login elsewhere. Furthermore, I have a largish table of existing users each with their own username/email/password and I'd like to continue having them login with these credentials without interruption.
I suppose my ultimate question is what is a state-of-the-art means of authentication in a PHP-driven website?. Any details about roll-your-own systems you folks may have are most welcome. E.g., if you use [man]password_hash[/man], what algorithm do you specify? Does anyone ever use the default hash algo? Does anyone provide their own options to specify a cost and/or salt?
Implementations also quite welcome!