Couldn't find a way to add data to a authentication response, so I added a new hook for this purpose.

Patch attached, please review.

Comments

sanduhrs’s picture

StatusFileSize
new612 bytes

In the previous patch I passed the response, not the request to the hook.
Changed that, now it's possible work with the whole request and decide what to respond.
Patch attached.

sanduhrs’s picture

StatusFileSize
new623 bytes

Alright, seems we need both ;)
Patch attached.

sanduhrs’s picture

StatusFileSize
new622 bytes

Switching order of $request and $response, as in openid.module the first argument is $response, not $request.
Updated patch attached, please have a look.

darren.ferguson’s picture

Patch looks good to me for the module, it will allow you to check the request for pieces such as attribute exchange and provide the additional information in the response back to the user.

darren.ferguson’s picture

After looking at this, the client side openid module from drupal core implements hook_openid. This is fine since it has the correct variables in it, however i believe for the provider side we need to implement a hook_openid_provider that will deal with the responses. This will allow us to have the hook similar to below:

/**
 *
 */
function hook_openid_provider($op = 'response', $response = array(), $request = array()) {

$op will be response, or signed depending and this way we keep the module away from the client implementation. I think that is a better approach however correct me if i am wrong on this one.

anarcat’s picture

Status: Needs review » Needs work

I agree the hook shouldn't be hook_openid. Also, hook_openid_provider is a bit too generic, isn't it? Shouldn't we just say hook_openid_provider_response?

asak’s picture

subscribing...

anarcat’s picture

Status: Needs work » Fixed

So this is pretty weird: the code is already there!

  // calling hook_openid so we can do response parsing and send any pertinent data back to the user
  $response = array_merge($response, module_invoke_all('openid_provider', 'response', $response, $request));

So I'm closing this issue, reopen if the feature is still missing.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.