title: Zend OpenId 2.0 Support
body: <p>I need to signup a user by OpenId (for example google)<br />
  But it is not working!</p>
  
  <p>I have already see some topics:<br />
  <a href="http://framework.zend.com/issues/browse/ZF-6905" rel="nofollow noreferrer">http://framework.zend.com/issues/browse/ZF-6905</a><br />
  <a href="https://stackoverflow.com/questions/3868851/zend-openid-and-google">Zend OpenId and Google</a><br />
  And others..</p>
  
  <p>But all of that is not works!</p>
  
  <p>I need to fetch user info (such as login or email) but if I use like this</p>
  
  <pre><code>// $data['openidIdentifier'] = 'https://www.google.com/accounts/o8/id';
  public function loginByOpenIdAction() {
      $request = $this-&gt;getRequest();
      $form = new Application_Form_UsersLoginByOpenId();
  
      $this-&gt;view-&gt;headTitle('Login by OpenId');
  
      if ($request-&gt;isPost()) {
          $data = $request-&gt;getPost();
          if ($form-&gt;isValid($data)) {
              $consumer = new Zend_OpenId_Consumer();
              $backUrl = $this-&gt;getHelper('Url')-&gt;url(array('controller' =&gt; 'users', 'action' =&gt; 'signup-from-open-id'));
  
              if (!$consumer-&gt;login($data['openidIdentifier'], $backUrl)) {
                  $this-&gt;view-&gt;error = 'Can`t connect to OpenId provider';
              }
          }
      }
  
      $this-&gt;view-&gt;form = $form;
  }
  
  public function signupFromOpenIdAction() {
      $consumer = new Zend_OpenId_Consumer();
      $data = &amp;$_GET;
  
      $sreg = new Zend_OpenId_Extension_Sreg(array(
          'nickname' =&gt; true,
          'email' =&gt; false,
          'fullname' =&gt; false), null, 1.1
      );
  
      if ($consumer-&gt;verify($data, $id, $sreg)) {
          $properties = $sreg-&gt;getProperties();
          var_dump($properties);
          var_dump('allow', $id);
      } else {
          var_dump('deny', $id, $consumer);
      }
      die;
  }
  </code></pre>
  
  <p>And the output is:</p>
  
  <pre>
  string 'deny' (length=4)
  string 'https://www.google.com/accounts/o8/id?id=fooBarFooBar' (length=80)
  object(Zend_OpenId_Consumer)[61]
    protected '_storage' => 
      object(Zend_OpenId_Consumer_Storage_File)[62]
        private '_dir' => string '/tmp/azat/openid/consumer' (length=25)
    protected '_dumbMode' => boolean false
    protected '_cache' => 
      array
        empty
    private '_httpClient' => null
    private '_session' => null
    private '_error' => string 'Extension::parseResponse failure' (length=32)
  </pre>
  
  <p>Please help: how can i fetch user info from openid server (for example google) for signup user?</p>
  
  <p>If I use <code>$consumer-&gt;verify($data, $id)</code> than all ok, but I need user info for signup</p>
  
  <p>And also I use Zend_OpenId_Consumer from this issue <a href="http://framework.zend.com/issues/browse/ZF-6905" rel="nofollow noreferrer">http://framework.zend.com/issues/browse/ZF-6905</a>, because with native Zend_OpenId_Consumer <code>$consumer-&gt;verify($data, $id)</code> this is not works</p>
  
  <p>Also suggestions to use some brokers, or other libs working with openid not offer.</p>