0

I have downloaded LightOpenID (http://gitorious.org/lightopenid) and it worked but few days ago stopped. My code:

<?php
require 'openid.php';
try {
if(!isset($_GET['openid_mode'])) {
    if(isset($_GET['login'])) {
        $openid = new LightOpenID('my-domain.com');
        $openid->identity = 'https://www.google.com/accounts/o8/id';
            $openid->required = array('namePerson/friendly', 'contact/email');
        header('Location: ' . $openid->authUrl());
    }
?>
<form action="?login" method="post">
<button>Login with Google</button>
</form>
<?php
} elseif($_GET['openid_mode'] == 'cancel') {
    echo 'User has canceled authentication!';
} else {
    $openid = new LightOpenID('my-domain.com');
    echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
echo '<pre>'.print_r($openid,true).'</pre>';
?>

At localhost it works but not on the web server.

Edit: I found older version of LightOpenID and it works.

be4code
  • 688
  • 4
  • 15
  • Check settings related to curl on the web server. It may be [this problem][1]. [1]: http://stackoverflow.com/questions/4694986/google-openid-not-working-with-openid-plugin-in-wordpress – Vanwaril Apr 25 '12 at 17:40

1 Answers1

0

There is a problem in the request_streams() method, I resolved it by commenting the line 352 and replacing it with return $data;

//return file_get_contents($url, false, $context);
return $data;
radhouano
  • 71
  • 1
  • 3