There seem to bee some bugs in the AX implementation, especially in the functions fromSuccessResponse and fromOpenIDRequest.
To do a fetch request, I use this code at the consumer:
$fetch_request = new Auth_OpenID_AX_FetchRequest;
$fetch_request->add(new Auth_OpenID_AX_AttrInfo('http://schema.openid.net/contact/email',1,true,'email'));
if ($fetch_request) {
$auth_request->addExtension($fetch_request);
}
The Idp tries to extract the fetch request as follows:
$ax_req = Auth_OpenID_AX_FetchRequest::fromOpenIDRequest($info);
But $ax_req contains an error Object, saying "expected mode 'fetch_request'; got"
Ignoring this error, I let the Idp give a fetch response with this code:
$ax_resp = new Auth_OpenID_AX_FetchResponse();
$ax_resp->addValue('http://schema.openid.net/contact/email',$email);
$response->addExtension($ax_resp);
Then the consumer tries to extract the fetch response:
$ax_resp = Auth_OpenID_AX_FetchResponse::fromSuccessResponse($response)
But the function returns null instead of a fetch response object.
To do a store request, the consumer does this:
$store_request = new Auth_OpenID_AX_StoreRequest;
$store_request->addValue('http://schema.openid.net/contact/email',$email);
$auth_request->addExtension($store_request);
The Idp tries to extract the request:
$store_req = Auth_OpenID_AX_StoreRequest::fromOpenIDRequest($info);
$ax=$store_req->data;
The store request object can be retrieved, but the data array is empty.
Before I added the function fromopenidrequest to the ax implementation:
function &fromOpenIDRequest($request)
{
$m = $request->message;
$obj = new Auth_OpenID_AX_StoreRequest();
$ax_args = $m->getArgs($obj->ns_uri);
$result = $obj->parseExtensionArgs($ax_args);
return $obj;
}