Gracias a algún otro comentario sobre Stackoverflow.com Yo he venido a aprender sobre LightOpenId. Es realmente fácil de usar.
El código example simplemente funciona (sin ningún tipo de configuración):
<?php
require 'openid.php';
try {
$openid = new LightOpenID;
if(!$openid->mode) {
if(isset($_POST['openid_identifier'])) {
$openid->identity = $_POST['openid_identifier'];
header('Location: ' . $openid->authUrl());
}
?>
<form action="" method="post">
OpenID: <input type="text" name="openid_identifier" /> <button>Submit</button>
</form>
<?php
} elseif($openid->mode == 'cancel') {
echo 'User has canceled authentication!';
} else {
echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
Usando google as openid provider.
<?php
# Logging in with Google accounts requires setting special identity, so this example shows how to do it.
require 'openid.php';
try {
$openid = new LightOpenID;
if(!$openid->mode) {
if(isset($_GET['login'])) {
$openid->identity = 'https://www.google.com/accounts/o8/id';
header('Location: ' . $openid->authUrl());
}
?>
<form action="?login" method="post">
<button>Login with Google</button>
</form>
<?php
} elseif($openid->mode == 'cancel') {
echo 'User has canceled authentication!';
} else {
echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
Nuestro propio StackOverflow utiliza OpenID. Además, existen bibliotecas OID para la mayoría de los lenguajes y marcos. Pero es bastante sencillo. Para registrar a alguien con su OpenID, puede redirigir a un sitio especificado por el OID y si ese sitio puede verificar la identidad del usuario, le dará un secreto para usar. Ese secreto funciona como la contraseña del nombre de usuario que es el OID. Por lo tanto, es igual de seguro, o más, pero transfiere la autenticación del usuario al sitio emisor. – Robert
posible duplicado de http://stackoverflow.com/questions/42407/how-do-i-implement-openid-in-my-web-application –