stackoverflow.com bazı diğer yorum sayesinde ben yaklaşık LightOpenId öğrenmeye geldi. Kullanımı gerçekten çok kolay.
example kod sadece (herhangi bir yapılandırmaya gerek kalmadan) çalışır:
<?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();
}
google as openid provider kullanma.
<?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();
}
Kendi StackOverflow'umuz OpenID kullanır. Ayrıca, çoğu dil ve çerçeve için OID kitaplıkları bulunur. Ama oldukça basit. Birisi OpenID'leriyle giriş yapmak için OID tarafından belirtilen bir siteye yönlendirilirsiniz ve bu site kullanıcının kimliğini doğrulayabilirse, kullanmanız için size bir sır verecektir. Bu gizli OID olan kullanıcı adı için şifre gibi çalışır. Yani her şey güvenli, ya da daha çok, ama kullanıcı kimlik doğrulamasını yayınlayan siteye aktarıyorsunuz. – Robert
http://stackoverflow.com/questions/42407/how-do-i-implement-openid-in-my-web-application –