The 4.7 version had a server component. Would it be possible to port this to the 6.x version?

Comments

hass’s picture

OpenID is part to D6.

damien_vancouver’s picture

I would definitely be willing to help with porting the server part to 5 and/or 6.

I assume there is something complicated involved that stopped it being ported to 5 (or was it just a lack of resources)?

anyway this is something I could really use and so I can devote some significant workday time to it. I would prefer to go with a single 5.x site infrastructure for the project I need it for, but I would help get it all the way to 6 if feasible.

damien_vancouver’s picture

@hass,

I think just the OpenID client portion (people logging into your site with their OpenID) is ported.

The server portion (your drupal site acting as the OpenID server to log people in elsewhere) is still Drupal 4.7 only I think.

can someone verify whether this is the case?

damien_vancouver’s picture

hass’s picture

I'm not a OpenID user yet, but i thought i can login with my domain in every site having openid login enabled and vice versa. Not sure... but i thought this. Everything else makes no sense to me... where should i get an openID if not on my own domain.

damien_vancouver’s picture

You can just put some

So then if you go log in with www.example.com say, the site you're logging into will look that up and get relayed to the proper OpenID URL (which is usually something longer).

Another thing you can do is use an XRI iName, then you could have something like "=hass" and it functions as your OpenID URL, and the iName registrar you pick runs the server for you.

personal inames start with = like that (I have =damien) and run you about $10 a year. Or you can run your own openID server or just have an account on someone else's and use that and not pay the $10 a year. iNames/XRI/XDI will offer other advantages that make it worthwhile, but in the future (for now they are mainly useful as a kitschy openID login that's shorter than an URL).

but yeah ultimately something has to act as your server for your OpenID login. The 4.7 server module lets you do that right off your drupal site rather than borrowing/paying for someone else's.

jax’s picture

StatusFileSize
new1.23 KB

I've started the port of the openid_server.module from the 4.7 branch to D6. I'll upload as I progress. Feedback and comments are welcome.

jax’s picture

StatusFileSize
new6.21 KB

Alright. The basic version is almost working. In one of the last steps the openid.return_to key is missing and it gets stuck in a redirect loop (line 523). Also I've done no effort towards xrds and delegation, that might be for later.

jax’s picture

StatusFileSize
new6.23 KB

w00t! It successfully authenticated against a Zend_OpenId_Consumer().

What is left to do:
- The Drupal openID client uses http://xri.net/ for the discovery. So you have to test on a public website to see if it works. This means that discovery of the server does not work with drupal for the moment.
- There are still some bugs left which I will squash when I continue working on this.

If you want to test the authentication part use a simple openId client. I downloaded the Zend Framework and used "The copmlete openID login script" as client. You will have to change the $_GETs to $_REQUESTs because Drupal returns with a POST, not a GET.

jax’s picture

StatusFileSize
new7.18 KB

This is cleaning up nicely. This still needs to be done to have something that is actually usable:

  • You currently cannot use the same drupal installation to do the client and the server at the same time because they share the openid_association table. I'll see if I can use a openid_server_association table for the server but it's possible that functions from the clients are used that rely on that table.
  • The 4.7 server supported XRDS discovery. This one doesn't. Yet.
  • There seems to be an issue with the Drupal OpenID client. It doesn't set openid.trust_root. Need to investigate further.
  • There is some cleaning up to do on the user pages and code.

If you test, don't forget to set the "access user profiles" for everyone.

A nice feature would be to be able to use http://nickname.example.com as openid with drupal. It should be possible with some Rewrite magic and a bit more code. But that's for later.

jax’s picture

StatusFileSize
new7.19 KB
  • This one has its own openid_server_association table which removes the dependency that the openId client has to be enabled.
  • The authorized sites form actually works. It wanted to have it in the form of a table but my theming function is not being called.
  • I've removed most of the debugging code.

I should also note that this only supports the authentication so far. The extension for passing the attributes (like username, first name, etc) doesn't work yet. Also there are some other openId features that are not yet implemented. But for authentication, it works.

If you test, don't forget to set the "access user profiles" for everyone.

jax’s picture

StatusFileSize
new7.13 KB

And yet another version with the authorized sites in a nice table. I've also created a patch for the openID client issue: http://drupal.org/node/245826.

yngens’s picture

Jax, though i haven't used your code yet, I would like to thank you for this excellent job. Drupal 5 and 6 needed server side OpenId from long ago.

For what you said "A nice feature would be to be able to use http://nickname.example.com as openid with drupal. It should be possible with some Rewrite magic and a bit more code. But that's for later." probably this module can help, please take a look: http://drupal.org/project/subdomain

yngens’s picture

have tried now and, unfortunately, it did not work for me. additionally it's given this error:

notice: Undefined index: weight in /home/mysite/public_html/modules/user/user.module on line 1107.

jax’s picture

Status: Active » Closed (fixed)

Hi, I'm unsure how this error is related to this module. Walkah apparently also ported the code and is implementing a 2.0 server, so please direct your testing efforts towards that project.

http://drupal.org/project/openid_provider