OpenID vs. β: FINAL FIGHT! // VOID-STAR.NET

100% cheshire.

OpenID vs. β: FINAL FIGHT!

Well fuck me.

Remember that problem with the WordPress OpenID plugin? The one that I just couldn’t solve, because the PHP OpenID library is so fucking obtuse? The one that I spent days and days on, just kinda randomly dumping out variables? The one that worked on my local site but none of my hosted domains? That one?

Well, I fixed it. Kinda.

After a lot of dicking about and literally hundreds of emails filled with dumped variablesi I finally narrowed the issue down to somewhere around _httpResponseToMessage() in Consumer.php. Oddly, I noticed that each time I made an OpenID authorisation request, this function would run twice. Once with “real” return data, and one subsequent to that with some kind of error message. Oh-kay, thinks I. So I went and enabled WP_DEBUG.

Cue massive weirdness, and suddenly a whole host of “MySQL server has gone away” errors when trying to update the plugin’s table data. Lol whut?

So in what I thought was a stroke of debugging genius (ha-hah!), I compared the vardumps from the failed run at β with the successful run on my local machine. The difference? My local machine is running as session_type:no-encryption, while β is trying for session_type:DH-SHA1.

WP-OpenID’s handy status pane reveals that this seems to be caused by my local machine’s version of PHP having no capacity for big integer mathematics.ii Meanwhile, β is trying to use the BCMath library. WP-OpenID recommends GMP.iii

Well, installing GMP isn’t really an option, but forcing the plugin to run with no encryption (“dumb mode“) is. So I hacked up lines 106-108 of OpenID.php to force Auth_OpenID_setNoMathSupport(), even if Auth_OpenID_getMathLib() evaluates.

Viola! We have OpenID liftoff.

Anyway, the point of this is:

  1. To remind me what to do when I next update the plugin and it breaks again; and
  2. To inform those of you with OpenIDs (read: LiveJournals) that you may now comment/login using solely your OpenID URL. Hopefully.

I find it kind of scary that, despite the site still being in closed beta, my user ID at Dreamwidth is still higher than my user ID at LiveJournal.

The internet is a much, much bigger place nowadays than it was ten years ago…

  1. Oh print_r( get_defined_vars(), true ) how I love thee…
  2. My original guess was some kind of SSL thing, but this will do too.
  3. This, incidentally, would account for why the plugin is failing on all my domains, too; since they’re all on the same host, thus all have the same PHP libraries.

544 words posted 561 days ago at 8:43 pm.

This entry has 5 comments from Juno. Tell Dee what you think?

Filed under WordPress and tagged with , , , , , .

Written while feeling geeky.

Crossposted to dee.dreamwidth.org, loqia.insanejournal.com, loqia.journalfen.net.

Related posts...


5 Comments

  1. 557 days ago
    12 comments

    Juno

    *sigh* I hear your pain.

    I can’t get the OpenID plugin to bypass my Math Anti-Comment Spam plugin…

    • 557 days ago
      1,606 comments

      Dee

      Hrm.

      Yeah, not sure about that one. You’d have to see which plugin is running first and then… urgh. It’s a lot of coding. >_O

      Honestly, though, considering the amount of spambots with LJ URLs, it’s probably for the best. ^^”

      • 557 days ago
        12 comments

        Juno

        Good point. *g*

        And if a question like 1+5=? stymies commenters, I don’t think I absolutely need to know what they want to crit in my fic. *big meanie*

        • 557 days ago
          1,606 comments

          Dee

          “You must be at least this smart to comment.”

          • 557 days ago
            12 comments

            Juno

            *snigger* Ages and ages ago there was an anti-comment spam plugin that allowed you to post customised spam questions. They suggested asking things like “Which colour is an orange?” (orange) or “What is the first letter of black?” or stuff like that. I always thought that would be a FABULOUS plugin for a fandom blog – ask people “What’s my OTP?” or “What does HP mean?” Unfortunately, the plugin stopped working ages ago…

Add a Comment

Add a Comment

A legitimate email address or OpenID-enabled URL (e.g. your Dreamwidth journal) is required. Links to LiveJournal accounts will be removed due to malware on that site. First-time comments are both welcome and moderated. Some HTML is allowed. There is no free speech.