I am currently experimenting with implementing an openID for a small website for college. I am very new to this and have followed up with related articles. I have downloaded lightopenId and uploaded the folder to my webserver. My school has google hosting their email service so typical email addresses are: like this studentlastname@myuniversity.edu
. We can login through mail.google.com
or a custom web page designed by google specifically for our login mail.google.com/a/oakland.edu/
.
Instead of having users be redirected to the general $openid->identity = 'https://www.google.com/accounts/o8/id';
can I have the users directed to the custom university google hosted page to authenticate?
Gives me error:
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();
}
As far as I know, the correct identity in your case would be:
https://www.google.com/accounts/o8/site-xrds?hd=oakland.edu
This url returns a valid XRDS (so LightOpenID will find a server).
Note that if the server isn't configured properly, you might get a similar error when calling validate()
.