Lightopenid,Gmail Auth,显示弹出窗口而不是整页窗体

时间:2011-10-21 10:13:08

标签: lightopenid

我正在使用lightopenid对gmail进行身份验证。

找到here

显示gmail登录页面的默认方式是整页版本。但我注意到其他网站显示“弹出版本”,并在URL中

&ltmpl=popup

我查看了代码,看不到向auth URL字符串添加一些自定义选项的方法。

有没有人设法做到这一点?

    try 
    {
        $lightopenid = new Lightopenid;
        $lightopenid->required = $required_attr;

        if(!isset($_GET['openid_mode'])) 
        {
            $ui = "&openid.ns.ui=" . urlencode('=http://specs.openid.net/extensions/ui/1.0') . "&openid.ui.mode=popup";

            $lightopenid->identity = 'https://www.google.com/accounts/o8/id';               
            redirect($lightopenid->authUrl() . $ui, 'refresh');
        }

由于

1 个答案:

答案 0 :(得分:2)

由于$openid->authUrl()会返回一个网址,因此添加一个选项并不太难。

据我所知,这是正确的方法:

$ui = "&openid.ns.ui=" . urlencode('http://specs.openid.net/extensions/ui/1.0') . "&openid.ui.mode=popup"
header('Location: ' . $openid->authUrl() . $ui);