Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8272007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:59:46+00:00 2026-06-08T06:59:46+00:00

Using the LightOpenID class, I am trying to get Google’s login integrated with my

  • 0

Using the LightOpenID class, I am trying to get Google’s login integrated with my site. I’m using the default code:

<?php
require 'includes/openid.php';

try {
    if(!isset($_GET['openid_mode'])) {
        if(isset($_GET['login'])) {
            $openid = new LightOpenID;
            $openid->identity = 'https://www.google.com/accounts/o8/id';
            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;
        echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
    }
} catch(ErrorException $e) {
    echo $e->getMessage();
}
echo '<pre>'.print_r($openid,true).'</pre>';
?>

Originally, this was telling me I was missing argument 1 for the construct method, forcing me to to call the new LightOpenID method as new LightOpenID($host). But since I had changed it and tried logging in, it’s not giving that error when I reverted the code back just go grab the error…

Anyway, that point aside, after I added the host I was taken to the google page where it asked if I wanted to sign into the site with my google account. I pressed the sign-in button and was taken back only to be told that I was not signed in.

User has not logged in.

LightOpenID Object
(
    [returnUrl] => myReturnURL
    [required] => Array
        (
        )

    [optional] => Array
        (
        )

    [verify_peer] => 
    [capath] => 
    [cainfo] => 
    [data] => Array
        (
            [login] => 
            [openid_ns] => http://specs.openid.net/auth/2.0
            [openid_mode] => id_res
            [openid_op_endpoint] => https://www.google.com/accounts/o8/ud
            [openid_response_nonce] => 2012-07-23T14:06:24ZQwlS1zWFRdvg6A
            [openid_return_to] => myReturnURL
            [openid_assoc_handle] => AMlYA9WMwp_rTkH3swNLEF5UASFvhyOR-kqVSXGe7cvXe7ws5z8HHWUu
            [openid_signed] => op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle
            [openid_sig] => NtOEY8dUM1Hpt2tTR9x0RdN5o1c=
            [openid_identity] => https://www.google.com/accounts/o8/id?id=AItOawkXNCi5qq-3Vj_esgSQAwmEN_nVIC8BHAQ
            [openid_claimed_id] => https://www.google.com/accounts/o8/id?id=AItOawkXNCi5qq-3Vj_esgSQAwmEN_nVIC8BHAQ
        )

    [identity:LightOpenID:private] => 
    [claimed_id:LightOpenID:private] => https://www.google.com/accounts/o8/id?id=AItOawkXNCi5qq-3Vj_esgSQAwmEN_nVIC8BHAQ
    [server:protected] => https://www.google.com/accounts/o8/ud
    [version:protected] => 2
    [trustRoot:protected] => mySite
    [aliases:protected] => 
    [identifier_select:protected] => 
    [ax:protected] => 1
    [sreg:protected] => 
    [setup_url:protected] => 
    [headers:protected] => Array
        (
            [cache-control] => no-cache, no-store, max-age=0, must-revalidate
            [pragma] => no-cache
            [expires] => Fri, 01 Jan 1990 00:00:00 GMT
            [date] => Mon, 23 Jul 2012 14:06:26 GMT
            [content-type] => text/plain; charset=UTF-8
            [x-content-type-options] => nosniff
            [x-frame-options] => SAMEORIGIN
            [x-xss-protection] => 1; mode=block
            [server] => GSE
        )

)

I was already signed into Google, so the Google page did not ask me to log in, just to verify that I wanted to sign into my own website using my Google account. Does anyone see a reason why it is not saying I am signed in?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:59:48+00:00Added an answer on June 8, 2026 at 6:59 am

    Use the newest version, and it should work.

    Just remember that the newer versions of the library require an argument in the constructor:

    $openid = new LightOpenId('www.domain.com');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using LightOpenID to enable Google Authentication in my PHP web application. However
I'm using lightopenid as the login system for a site and after successful login,
I am using lightopenID and am still using the example-google.php file included. I have
I am using LightOpenID php class ie openid.php class. I want to fetch the
I am currently using LightOpenID to allow users to log into my site, where
I'm getting confused. I was able to make openid login kinda work using LightOpenID
I am developing an OpenID consumer in PHP and am using the fantastic LightOpenID
I'm utilizing LightOpenID and I'm trying to get attributes for this gmail authentication but
I'm using lightopenid for authentication to gmail. Found here : The default way of
Using rubular.com as a guide, I am trying to get this expression to work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.