현재 저는 대학을위한 작은 웹 사이트에 대해 openID를 구현하고 있습니다. 나는 이것에 아주 새롭다 관련 기사를 철저히 구명했다. lightopenId를 다운로드하고 폴더를 내 웹 서버에 업로드했습니다. 내 학교에서 이메일 서비스를 호스팅하는 Google의 이메일 주소는 다음과 같습니다 : [email protected]
. mail.google.com
을 통해 로그인하거나 Google에서 로그인을 위해 특별히 디자인 한 사용자 정의 웹 페이지 mail.google.com/a/oakland.edu/
을 사용할 수 있습니다.대학용 lightopenID Google 호스팅 이메일
사용자를 일반 $openid->identity = 'https://www.google.com/accounts/o8/id';
으로 리디렉션하는 대신 사용자 지정 대학 google 호스팅 페이지로 이동하여 인증 할 수 있습니까?
No OpenID Server found at
http://mail.google.com/a/oakland.edu/accounts/o8/id
openid.php :
<?
<?php
require 'openid.php';
try {
# Change 'localhost' to your domain name.
$openid = new LightOpenID('http://webprolearner.ueuo.com');
if(!$openid->mode) {
if(isset($_GET['login'])) {
$openid->identity = 'mail.google.com/a/oakland.edu/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();
}
완벽! 이것이 잘 작동합니다! – techAddict82
아, 그래, 알았어. http://oakland.edu/openid?id=103676657823296937874에서 오픈 ID 서버를 찾지 못했습니다. 내가 지금 무엇을 할 수 있을까? – techAddict82
oakland.edu/openid에서 xrds 문서를 반송하거나 다른 사람에게 방향을 바꿀 수있는 사람에게 물어보십시오. 예를 들어, 다음 코드를 포함 시켜서 :' php header ('X-XRDS-Location : https://www.google.com/accounts/o8/site-xrds?hd=oakland.edu'); ?>'. 불행하게도 "유효한"URL을 확인하기 위해 라이브러리를 해킹하고 싶지 않으면 (그리고 openid 사양을 깨뜨리지 않는 한) 다른 방법은 없습니다. – Mewp