I can't figure out how to get SREG extension values when using Zend_Auth_Adapter_OpenId. I'm following these documentation pages:
http://framework.zend.com/manual/en/zend.auth.introduction.html
http://framework.zend.com/manual/en/zend.openid.consumer.html
In the documentation on Zend_Auth, it says when using OpenID to make a second call to authenticate(), like this:
$auth_result = $auth->authenticate(new Zend_Auth_Adapter_OpenId());
And that works, with $auth_result ending up as Zend_Auth_Result::SUCCESS.
However, in the Zend_OpenId_Consumer documentation, in order to get at the returned SREG data it says to do this:
$sreg = new Zend_OpenId_Extension_Sreg(array('email'=>false,'fullname'=>false), null, 1.1);
$consumer = new Zend_OpenId_Consumer();
$consumer->verify($_GET, $id, $sreg);
And that works too, as verify() returns true and $sreg->getProperties() returns the SREG fields I requested.
The problem is that I cannot do both of these things! If I make that call to authenticate() first, then verify() returns false. If I verify() first, then authenticate() returns Zend_Auth_Result::FAILURE. Looking at the code in Zend/Auth/Adapter/OpenId.php, it's evident that authenticate() is calling verify() internally, which makes sense. However the SREG values that are populated by this internal call are not exposed through any means I can see. What am I missing?
(While typing this and experimenting I discovered that I can just grab the SREG values off of $_GET, e.g. $_GET['openid_sreg_email'], but that doesn't seem like it would be the intended pattern. It solves my problem, but I would still like to know if there is a more official solution.)