0

I'm using lightopenid for authentication to gmail.

Found here:

The default way of presenting the login page for gmail is the full page version. But I have noticed other websites showing a "popup version" and in the URL is

&ltmpl=popup

I've looked through the code and can't see a way of adding some custom options to the auth URL string.

Has anyone managed to do this?

    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');
        }

Thanks

PaulM
  • 3,281
  • 3
  • 28
  • 38

1 Answers1

2

Since $openid->authUrl() returns an url, adding an option to it isn't too hard.

As far as I know, this is the correct way to do it:

$ui = "&openid.ns.ui=" . urlencode('http://specs.openid.net/extensions/ui/1.0') . "&openid.ui.mode=popup"
header('Location: ' . $openid->authUrl() . $ui);
Mewp
  • 4,715
  • 1
  • 21
  • 24
  • I'm looking at functions authUrl_v1 and authUrl_v2. I can't see where to put the code you mention. Can you please give me a more verbose code. Thanks – PaulM Oct 21 '11 at 18:03
  • You're looking in the wrong place. Look at example.php, where authUrl() is used. If you're already using LightOpenID, you also have a line like `header('Location: ' . $openid->authUrl());` and you should modify that line to the code I posted above. – Mewp Oct 22 '11 at 17:24
  • nope, still not working. I have updated my question to show you what I am doing. – PaulM Oct 22 '11 at 17:57
  • Ok, I've made a typo which I missed earlier. Try removing the '=' in urlencode(), so that it encodes only an url. Updated my answer to reflect that. – Mewp Oct 24 '11 at 13:19
  • @Mewp hi frieds... this is not opening in new window.... its opening in same window.... guide me – Malaiyandi Murugan Mar 09 '13 at 10:07