Member Sign In
Not a member?

A Wired.com user account lets you create, edit and comment on Webmonkey articles. You will also be able to contribute to the Wired How-To Wiki and comment on news stories at Wired.com.


It's fast and free.

Webmonkey is a property of Wired Digital.
processing...
Join Webmonkey

Please send me occasional e-mail updates about new features and special offers from Wired/Webmonkey.
Yes No

Please send occasional e-mail offers from Wired/Webmonkey affiliated web sites and publications, and carefully selected companies.
Yes No

I understand and agree that registration on or use of this site constitutes agreement to Webmonkey's User Agreement and Privacy Policy.
Webmonkey is a property of Wired Digital.
processing...

Retrieve Sign In

Please enter your e-mail address or username below. Your username and password will be sent to the e-mail address you provided us.

or
Webmonkey is a property of Wired Digital.
processing...

Welcome to Webmonkey

A private profile page has been created for you.
As a member of Webmonkey, you can now:
  • edit articles
  • add to the code library
  • design and write a tutorial
  • comment on any Webmonkey article
Close
Webmonkey is a property of Wired Digital.

Sign In Information Sent

An e-mail has been sent to the e-mail address registered in this account.
If you cannot find it in your in-box, please check your bulk or junk folders.
Sign In
Webmonkey is a property of Wired Digital.

Be Your Own OpenID Provider

/skill level/
/viewed/
0 Times

OpenID is a burgeoning standard for identifying and authenticating yourself on the web. You do this by identifying yourself not with a standard username and password, but with a URL. This URL points to a web page that verifies that you are, in fact, you.

A number of third-party sites offer OpenID URLs to their users, including LiveJournal, AOL, and Technorati. But some people do not like to be beholden to third parties for something that may turn out to be a central part of their online identity, and they'd rather host their own.

An easy way to do that is with an open source PHP identity server called phpMyID.


Contents

What You'll Need

  • A web server running PHP

Installing phpMyID

Download the latest source from http://siege.org/projects/phpMyID/. Create a subdirectory in your web directory called phpmyid. Place the files MyID.config.php and MyID.php in that directory, setting their ownership to the web user, if necessary.

In your web browser, go to http://yourwebserver/phpmyid/MyID.config.php. The page should display.

This is an OpenID server endpoint. For more information, see http://openid.net/

Server: http://yourwebserver/phpmyid/MyID.config.php

Realm: phpMyID

Login

If you click the Login link, it'll prompt you for a username and password, which you haven't yet configured yet. To do that, you need to come up with a username and password, then create an MD5 hash of them.


To do this at a Unix command line with OpenSSL, feed the username and password you want to the md5sum utility in the format username:phpMyID:password. Replace "phpMyID" with the realm from above if your realm differed:

echo -n "username:phpMyID:password" | md5sum


The output will be a 32-character hexadecimal hash that looks like:

22a204f0bf622e4a35f3d71304378ca9

You must memorize this -- Ha, only kidding. Just copy it and be ready to paste it.

On Windows, feed the same username:phpMyID:password string into the MD5 hasher you're using.

Now open the file MyID.config.php in a text editor. Near the top are two lines:

    'auth_username' =>  'test',

    'auth_password' =>  '22a204f0bf622e4a35f3d71304378ca9

Replace 'test' with the username you chose, and replace the 32-character hash that's there with the hash you just generated.

Now when you click Login, enter your new username and password into the prompt. If you did everything correctly, it should tell you "You are logged in as username".


Using It

Now, to use this as your OpenID, you'll need a URL that points to it. Choose an HTML page under your control -- say, the front page of your site -- or create a new one. Add these two lines inside the head of that page:

<link rel="openid.server" href="http://yourwebserver/phpmyid/MyID.config.php">

<link rel="openid.delegate" href="http://yourwebserver/phpmyid/MyID.config.php">


Now, when you want to authenticate, simply give that page's URL. It'll prompt you for your username and password and then authenticate you.


Further Reading

For additional details, read the phpMyID README file. This file is also available in the downloaded package.

  • This page was last modified 22:35, 20 May 2008.
Edit this article
Reddit Digg
 
Subscribe now

Special Offer For Webmonkey Users

WIRED magazine:
The first word on how technology is changing our world.

Subscribe for just $10 a year