Google OpenID: Error: invalid_request

214 Views Asked by At

I am implementing OpenID using PHP in my website. The code i written as follows...

<?php
    session_start();
    require_once('openid.php');
    try 
    {
        # Change 'localhost' to your domain name.
        $openid = new LightOpenID('openid.ch.net16.com');
            $openid->required = array(
            'namePerson',
            'namePerson/first',
            'namePerson/last',
            'contact/email',
            );

        $openid->identity = 'https://www.google.com/accounts/o8/id';
        $openid->returnUrl = 'http://www.openid.ch.net16.com/home.php';
        if(!$openid->mode) 
        {
            $_SESSION['auth']="Google";
            header('Location: ' . $openid->authUrl());
        }
        else 
        {
                echo 'User has canceled authentication!';
        }
    }
    catch(ErrorException $e) 
    {
        echo $e->getMessage();
    }
?>

But google says as follows....

Error: invalid_request
Error in parsing the OpenID auth request.
Learn more

Please help me to solve this problem...........

0

There are 0 best solutions below