oxd-Perl Demo Site

This is a demo site for oxd-perl written using perl to demonstrate how to use oxd-perl to perform authorization with an OpenID Provider and fetch information.

Deployment

Prerequisites

  1. Client Server

  2. OpenID Provider

  3. Modules

    • CGI::Session module
    • Net::SSLeay module
    • IO::Socket::SSL module

Testing OpenID Connect with the demo site

Linux

$ sudo apt-get install perl
$ sudo apt-get install libapache2-mod-perl2 
$ cd /etc/apache2/sites-available
$ vim oxd-perl-example.conf
<IfModule mod_ssl.c>
    <VirtualHost _default_:443>

        DocumentRoot /var/www/html/oxd-perl/example/
        ServerName www.client.example.com
        ServerAlias client.example.com

        <Directory /var/www/html/oxd-perl/example/>
                        AllowOverride All
        </Directory>

        ErrorLog /var/www/html/oxd-perl/example/logs/error.log
        CustomLog /var/www/html/oxd-perl/example/logs/access.log combined

        AddType application/x-httpd-php .php
           <Files 'xmlrpc.php'>
                   Order Allow,Deny
                   deny from all
           </Files>

        SSLEngine on
        SSLCertificateFile  /etc/certs/demosite.crt
        SSLCertificateKeyFile /etc/certs/demosite.key

                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                        SSLOptions +StdEnvVars
                </FilesMatch>

                # processes .cgi and .pl as CGI scripts

                ScriptAlias /cgi-bin/ /var/www/html/oxd-perl/
                <Directory "/var/www/html/oxd-perl">
                        Options +ExecCGI
                        SSLOptions +StdEnvVars
                        AddHandler cgi-script .cgi .pl
                </Directory>

                BrowserMatch "MSIE [2-6]" \
            nokeepalive ssl-unclean-shutdown \
            downgrade-1.0 force-response-1.0
                BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

        </VirtualHost>
</IfModule>
$ sudo a2ensite oxd-perl-example.conf 
$ sudo nano /etc/hosts
127.0.0.1 www.client.example.com
127.0.0.1  client.example.com
$ sudo service apache2 restart

Set up and run the demo application. Navigate to perl app root:

Copy example folder from oxdPerl directory and placed on root folder

cd /var/www/html/oxd-perl/example

Windows

<VirtualHost *>
    ServerName client.example.com
    ServerAlias client.example.com
    DocumentRoot "<apache web root directory>"
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot "<apache web root directory>"
    ServerName client.example.com
    SSLEngine on
    SSLCertificateFile "<Path to ssl certificate file>"
    SSLCertificateKeyFile "<Path to ssl certificate key file>"
    <Directory "<apache web root directory>">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
ScriptAlias /cgi-bin/ "<path to CGI files>"
AddHandler cgi-script .cgi .pl
<Directory "<path to CGI files>">
    AllowOverride All
    Options None
    Require all granted
</Directory>