Hook to add response data
sanduhrs - September 25, 2008 - 05:35
| Project: | OpenID Provider |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
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.
| Attachment | Size |
|---|---|
| openid_provider_hook_response_0.patch | 613 bytes |

#1
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.
#2
Alright, seems we need both ;)
Patch attached.
#3
Switching order of $request and $response, as in openid.module the first argument is $response, not $request.
Updated patch attached, please have a look.
#4
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.
#5
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:
<?php/**
*
*/
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.
#6
I agree the hook shouldn't be
hook_openid. Also,hook_openid_provideris a bit too generic, isn't it? Shouldn't we just sayhook_openid_provider_response?#7
subscribing...
#8
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.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.