2

As we know Google Login is migrating from OpenId2.0 to OpenId connect. I have changed my code as like

require 'oauth/openid.php';
$openid = new LightOpenID;

  $openid->realm = "http://".$_SERVER[HTTP_HOST];
  $openid->identity = 'https://www.google.com/accounts/o8/id';
  $openid->required = array('contact/email');
  if (!headers_sent()){
       header('Location: '.$openid->authUrl());
  }else{
       echo '<script type="text/javascript">';
       echo 'window.location.href="'.$openid->authUrl().'";';
       echo '</script>';
   }
        }

But it is throwing an error like invalid parameters sent. Should I need to add/change anything?

William Denniss
  • 16,089
  • 7
  • 81
  • 124
GautamD31
  • 28,552
  • 10
  • 64
  • 85
  • Is there any more to this code? I can't see the instantiation of this object. – halfer Apr 13 '15 at 08:12
  • 1
    @halfer I already done it – GautamD31 Apr 13 '15 at 08:58
  • Your `HTTP_HOST` should be in quotes. If you can't see the notices this generates, then your errors may be turned off in your development environment. Try turning them on to see if there is something else you might have missed? – halfer Apr 13 '15 at 09:12
  • @halfer while migrating from openId2.0 to connect did i need to add anything else?like openid or anything..and if any site you know that explains each step rather than google developers website? – GautamD31 Apr 13 '15 at 09:16
  • @Gautam3164 Always use json_encode if you want to send data to javascript. Btw is there an answer yet? – inf3rno Apr 27 '15 at 02:32

0 Answers0