OpenID demo#


The OpenID Book, chapter 4 describes how to setup the sammple OpenID RP.

Install PHP#

The sample is based on PHP, and this was not yet installed on the scharnhorst VPS (Fedora core 5), so first install this, after manually installing yum (Fedora Core 5 RPMS available at ftp://alviss.et.tudelft.nl/pub/fedora/core/5/i386/os/Fedora/RPMS/ ), we run yum install php:

[root@scharnhorst yum.repos.d]# yum install php
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
core                                                                 [1/3]
core                      100% |=========================| 1.1 kB    00:00     
updates                                                              [2/3]
http://ftp1.skynet.cz/pub/linux/fedora/updates/5/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (111, 'Connection refused')>
Trying other mirror.
http://fedora.mirrors.lug.ro/fedora/linux/core/updates/5/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Date: Thu, 03 Jan 2008 18:58:23 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-22
Vary: accept-language,accept-charset
Accept-Ranges: bytes
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
Content-Language: en
Trying other mirror.
updates                   100% |=========================| 1.2 kB    00:00     
extras                                                               [3/3]
http://ftp.chg.ru/pub/Linux/fedora/linux/extras/5/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')>
Trying other mirror.
extras                    100% |=========================| 1.1 kB    00:00     
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 767 kB    00:09     
core      : ################################################## 2207/2207
Added 2207 new packages, deleted 0 old in 12.25 seconds
primary.xml.gz            100% |=========================| 362 kB    00:01     
updates   : ################################################## 1013/1013
Added 1013 new packages, deleted 0 old in 6.76 seconds
primary.xml.gz            100% |=========================| 1.3 MB    00:05     
extras    : ################################################## 4277/4277
Added 4277 new packages, deleted 0 old in 21.03 seconds
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for php to pack into transaction set.
php-5.1.6-1.6.i386.rpm    100% |=========================|  21 kB    00:00     
---> Package php.i386 0:5.1.6-1.6 set to be updated
--> Running transaction check
--> Processing Dependency: libaspell.so.15 for package: php
--> Processing Dependency: php-pear for package: php
--> Processing Dependency: libgmp.so.3 for package: php
--> Processing Dependency: libpspell.so.15 for package: php
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for aspell to pack into transaction set.
aspell-0.60.3-5.i386.rpm  100% |=========================|  30 kB    00:00     
---> Package aspell.i386 12:0.60.3-5 set to be updated
---> Downloading header for gmp to pack into transaction set.
gmp-4.1.4-6.2.1.i386.rpm  100% |=========================|  10 kB    00:00     
---> Package gmp.i386 0:4.1.4-6.2.1 set to be updated
---> Downloading header for php-pear to pack into transaction set.
php-pear-1.4.9-1.2.noarch 100% |=========================|  20 kB    00:00     
---> Package php-pear.noarch 1:1.4.9-1.2 set to be updated
--> Running transaction check
--> Processing Dependency: aspell-en for package: aspell
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for aspell-en to pack into transaction set.
aspell-en-6.0-2.i386.rpm  100% |=========================|  10 kB    00:00     
---> Package aspell-en.i386 50:6.0-2 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 php                     i386       5.1.6-1.6        updates           3.5 M
Installing for dependencies:
 aspell                  i386       12:0.60.3-5      core              959 k
 aspell-en               i386       50:6.0-2         core              1.6 M
 gmp                     i386       4.1.4-6.2.1      core              632 k
 php-pear                noarch     1:1.4.9-1.2      updates           354 k

Transaction Summary
=============================================================================
Install      5 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         
Total download size: 7.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): aspell-0.60.3-5.i3 100% |=========================| 959 kB    00:34     
(2/5): gmp-4.1.4-6.2.1.i3 100% |=========================| 632 kB    00:28     
(3/5): php-pear-1.4.9-1.2 100% |=========================| 354 kB    00:01     
(4/5): aspell-en-6.0-2.i3 100% |=========================| 1.6 MB    01:03     
(5/5): php-5.1.6-1.6.i386 100% |=========================| 3.5 MB    00:15     
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: aspell                       ######################### [1/5] 
  Installing: gmp                          ######################### [2/5] 
  Installing: php                          ######################### [3/5] 
  Installing: php-pear                     ######################### [4/5] 
  Installing: aspell-en                    ######################### [5/5] 

Installed: php.i386 0:5.1.6-1.6
Dependency Installed: aspell.i386 12:0.60.3-5 aspell-en.i386 50:6.0-2 gmp.i386 0:4.1.4-6.2.1 php-pear.noarch 1:1.4.9-1.2
Complete!

httpd config change#

Added the following to /etc/httpd/conf/httpd.conf:

#
#  config needed for OpenID demo:
<VirtualHost consumer.computerhok.nl:80>
  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" consumer
  ServerAdmin harry.metske@gmail.com
  DocumentRoot /var/openid/consumer/php-openid-2.0.0
  ServerName consumer.computerhok.nl
  ErrorLog logs/consumer-error.log
  CustomLog logs/consumer-access.log consumer
</VirtualHost>

Install consumer stuff#

Install into directory /var/openid/consumer (downloaded from http://www.openidenabled.com/php-openid/ )

Adapt /etc/php.ini#

The include_path has to be extended with /var/openid/consumer/php-openid-2.0.0.

Demo#

The demo now is available here: http://consumer.computerhok.nl/examples/consumer/

Create test account#

I signed up for a test account at openid.com, my test OpenID URL is now metskemtest.myopenid.com !
I activated the safe signin option, so I will only be prompted for my password on the OpenID Sing in page.

Find & Replace
×