dougu2240 2012-08-14 01:29
浏览 109
已采纳

lightopenID用于大学Google托管的电子邮件

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();
    }
  • 写回答

1条回答 默认 最新

  • dpje52239 2012-08-14 17:14
    关注

    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().

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛