1

I'm using the LightOpenID library to attempt to register a user via OpenID. Everything seems to be working just fine for Google authentication except that validate() always fails. I'm dumping $openid and all the data seems to be in order, though still, validate() fails.

I have seen this question LightOpenID validate() fail on Google Apps but my problem is slightly different as I've determined that the response isn't a server not found but that the server for some reason responds with is_valid: false. Why might this be?

Here's how I'm going about it (in Laravel):

// testing with Google
try {
    $openid = new LightOpenID();
    if (!$openid->mode) {
        $openid->required = array('contact/email');
        $openid->identity = 'https://www.google.com/accounts/o8/id';
        return Redirect::to($openid->authURL());
    } else if ($openid->mode == "cancel") {
        echo "User has canceled authentication.";
    } else {
        $attributes = $openid->getAttributes();

        // debugging 
        echo ($openid->validate()) ? "Logged in " : "Not logged in ";
        ?><pre><?php echo var_dump($openid);?></pre><pre><?php
        echo var_dump($attributes);?></pre><?php
    }
} catch (ErrorException $e) {
    echo $e->getMessage();
}
return View::make('home.index');

Any help would be greatly appreciated, thanks in advance.

Community
  • 1
  • 1
kladd
  • 159
  • 1
  • 9
  • You don't pass an argument to the constructor, which would indicate that you're using an old version of the library. Try the [newest](https://gitorious.org/lightopenid/lightopenid/blobs/master/openid.php) one, it might fix your issue. – Mewp Feb 24 '13 at 09:50

1 Answers1

0

I have had the same problem. After racking my brain trying to work it out I figured out the issue seems to be caused by the addition of $openid->required = array('contact/email');

Remove or comment out that line it will start working again. Why I am not sure.

Matthew R.
  • 4,332
  • 1
  • 24
  • 39
  • I have found the exact same thing. It is really silly because while validation fails it will return the email address. My implementation does not use curl even though it is installed. Because of another setting that effects it(which I can not change). Has anyone made any progress on this? – user2908587 Feb 17 '14 at 06:10