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.

AttachmentSize
openid_provider_hook_response_0.patch613 bytes

#1

sanduhrs - September 26, 2008 - 07:45

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.

AttachmentSize
openid_provider_hook_response_1.patch 612 bytes

#2

sanduhrs - September 26, 2008 - 21:00

Alright, seems we need both ;)
Patch attached.

AttachmentSize
openid_provider_hook_response_2.patch 623 bytes

#3

sanduhrs - October 3, 2008 - 09:28

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

AttachmentSize
openid_provider_hook_response_3.patch 622 bytes

#4

darren.ferguson - October 9, 2008 - 13:52

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

darren.ferguson - October 10, 2008 - 21:38

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

anarcat - March 12, 2009 - 22:54
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?

#7

asak - March 15, 2009 - 22:23

subscribing...

#8

anarcat - March 16, 2009 - 02:35
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.

#9

System Message - March 30, 2009 - 02:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.