Recently, the use of OpenID has become popular. It is convenient, fast and modern.
OpenID is an open decentralized single sign-on system that allows you to use one login and password on a large number of sites. On sites that support OpenID, users do not have to register and remember the data for each site. Instead, it is enough for them to be registered on the site of the OpenID identification provider (providing the identifier). Since OpenID technology is decentralized, any site can use the OpenID software as a means of entry; OpenID solves the problem without relying on a centralized site to authenticate the user. ( Wikipedia )
For me personally, for some time it was difficult to remember the ainu.myopenid.com line. Over time, of course, I remembered it, but now instead of
ainu.myopenid.com I write
ramainen.ru (my page, I remember it) everywhere, and the services understand me perfectly. Of course, I did not become an OpenID provider, but remembering and entering my OpenID has become much easier.
To make it yourself is very simple. But for this you need a personal server (hosting, you can free) with support for php, asp or any other language. Well, or a server (hosting) from a friend who, out of kindness, will do it on the subdomain nickname.
The idea is simple: when a service requests an OpenID server, it sends the parameter USER_AGENT in the header.
["HTTP_USER_AGENT"] =>
string (40) "php-openid / 2.1.1 (php / 5.2.6) curl / 7.15.5"
In php, this is ripped out with $ _SERVER ["HTTP_USER_AGENT"];
If such a header is available, it is necessary to redirect the browser to your registered OpenID provider (for example, nick.myopenid.com).
In php, the ready-made solution is very simple: in index.php (or in another main php file) we write the following lines in the first lines:
if (strpos ($ _ SERVER ["HTTP_USER_AGENT"], 'openid')! == false) {
header ("Location: http://ainu.myopenid.com/");
// instead of ainu.myopenid.com, substitute your OpenID
exit ();
}
The presence of the openid substring is checked (and what if they change the version).
Checked on MirTesen and comments on a couple of blogs.