I am using this module and Drupal as my OpenID server. However, when I upgrade it to Drupal7, I found that the SREG information(nickname, email) not passed to the Client. In Drupal6, I use a separate module to do that and that module does not have a Drupal 7 version. So I am looking into the code of OpenID provider and find that it is actually passing the SREG information. However, because namespace declaration is missing, so most consumer will not processing those SREG information.
Here is my solution:

In openid_provider.inc, I made this changes:

$response = array(
    'openid.ns' => OPENID_NS_2_0,
    'openid.mode' => 'id_res',
    'openid.op_endpoint' => openid_provider_url('openid/provider'),
    'openid.identity' => $identity,
    'openid.claimed_id' => $identity,
    'openid.return_to' => $request['openid.return_to'],
    'openid.response_nonce' => _openid_provider_nonce(),
    'openid.assoc_handle' => $assoc_handle,
    'openid.sreg.nickname' => $user->name,
    'openid.sreg.email' => $user->mail,
    'openid.ns.sreg'	=> 'http://openid.net/extensions/sreg/1.1'

In line 214, I append " 'openid.ns.sreg' => 'http://openid.net/extensions/sreg/1.1'" to the end of array, and now openid consumers will process those SREG information.

#1 openid_provider_sreg_d7_1529984.patch620 bytesanarcat


anarcat’s picture

That would be the attached patch, right?

Does this completely replace the sreg modules from D6? Why are the modules necessary at all if all is needed is this declaration?

I would rather avoid adding this if it fakes support for SREG and would instead wait for those third party modules to be ported to D7 instead... Please confirm.

anarcat’s picture

Status: Needs review » Fixed

actually, nevermind - looking at #1441586: SREG and AX keys aren't signed, so they are ignored by Drupal OpenID clients, i realise that we have *some* sreg stuff builtin here, so this seems perfectly reasonable. committed to both d6 and d7.

Status: Fixed » Closed (fixed)

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