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.
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.
processing...Welcome to Webmonkey
- edit articles
- add to the code library
- design and write a tutorial
- comment on any Webmonkey article
Sign In Information Sent
Be Your Own OpenID Provider
/skill level/
/viewed/
OpenID is a burgeoning standard for identifying and authenticating yourself on the web. You do this by identifying yourself with the URL of a site that verifies you're 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
- An MD5 hashing tool, such as md5sum on Unix or [Tutorial:Install and Use Cygwin | Cygwin] or md5.exe on Windows
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, no. 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.
/related_articles/
Special Offer For Webmonkey Users
WIRED magazine:
The first word on how technology is changing our world.
