Ticket #293 (new defect)

Opened 3 months ago

Last modified 2 months ago

Misc AX bugs

Reported by: http://nilspn.myopenid.com/ Assigned to:
Priority: major Milestone:
Keywords: Cc:
Project: php-openid OpenID Protocol: OpenID 2.x
Series: 2.x.x Web Browser:

Description

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;	
	}

Change History

10/06/08 17:07:51 changed by http://www.id.consul.cc/user/2057

I have the same problem. I also reference an enhancement that suggests that examples for the code be provided. This is the only example of PHP AX extension code that I could find.