Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin
Robin Sheat 4cbeeedbe8 Bug 6296: allow users to be authenticated by SSL client certs
This adds a new syspref: AllowPKIAuth. It can have one of three states:
* None
* Common Name
* emailAddress

If a) this is set to something that's not "None", and b) the webserver
is passing SSL client cert details on to Koha, then the relevant field
in the user's certificate will be matched up against the field in the
database and they will be automatically logged in. This is used as a
secure form of single sign-on in some organisations.

The "Common Name" field is matched up against the userid, while
"emailAddress" is matched against the primary email.

This is an example of what might go in the Apache configuration for the
virtual host:

    #SSLVerifyClient require # only allow PKI authentication
    SSLVerifyClient optional
    SSLVerifyDepth 2
    SSLCACertificateFile /etc/apache2/ssl/test/ca.crt
    SSLOptions +StdEnvVars

The last line ensures that the required details are
passed to Koha.

To test the PKI authentication, use the following curl command:
    curl -k --cert client.crt --key client.key  https://URL/
(look through the output to find the "Welcome," line to indicate that a user
has been authenticated or the "Log in to Your Account" to indicate that a
user has not been authenticated)

To create the certificates needed for the above command, the following series
of commands will work:
    # Create the CA Key and Certificate for signing Client Certs
    openssl genrsa -des3 -out ca.key 4096
    openssl req -new -x509 -days 365 -key ca.key -out ca.crt
    # This is the ca.crt file that the Apache config needs to know about,
    # so put the file at /etc/apache2/ssl/test/ca.crt

    # Create the Server Key, CSR, and Certificate
    openssl genrsa -des3 -out server.key 1024
    openssl req -new -key server.key -out server.csr

    # We're self signing our own server cert here.  This is a no-no in
    # production.
    openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key \
        -set_serial 01 -out server.crt

    # Create the Client Key and CSR
    openssl genrsa -des3 -out client.key 1024
    openssl req -new -key client.key -out client.csr

    # Sign the client certificate with our CA cert. Unlike signing our own
    # server cert, this is what we want to do.
    openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key \
        -set_serial 02 -out client.crt
    openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12
    # In theory we can install this client.p12 file in Firefox or Chrome, but
    # the exact steps for doing so are unclear, and outside the scope of this
    # patch

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tested with Common Name and E-mail authentication, as well as with PKI
authentication disabled. Regular logins continue to work in all cases when
SSL authentication is set to optional on the server.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
QA comment: synchronized updatedatabase.pl version of syspref with sysprefs.sql
version, to avoid divergent databases between new and upgrading users.
2012-03-19 17:02:44 +01:00
..
preferences Bug 6296: allow users to be authenticated by SSL client certs 2012-03-19 17:02:44 +01:00
admin-home.tt
aqbudget_owner_search.tt
aqbudgetperiods.tt Bug 6943: Added ability to duplicate a budget tree (from the edit sub menu) 2012-02-03 17:53:59 +01:00
aqbudgets.tt Bug 7114: Fixes the Funds' page display after the Filter link is clicked. 2012-02-17 10:06:51 +01:00
aqcontract.tt Bug 7113: Standardize vendor id name in templates and scripts 2012-02-17 19:04:00 +01:00
aqplan.tt Fix for Bug 6458 - incorrect parsing result in translation processing 2011-09-14 10:03:09 +12:00
auth_subfields_structure.tt
auth_tag_structure.tt Fix for Bug 6616 - Move common table pager markup to include 2011-10-09 20:07:35 +13:00
authorised_values.tt Fix for Bug 6616 - Move common table pager markup to include 2011-10-09 20:07:35 +13:00
authtypes.tt
biblio_framework.tt
branch_transfer_limits.tt Bug 6842 Alternate fix, Branch transfer limits broken 2012-02-01 22:38:32 +01:00
branches.tt Fix for Bug 6616 - Move common table pager markup to include 2011-10-09 20:07:35 +13:00
categorie.tt Fix for Bug 6616 - Move common table pager markup to include 2011-10-09 20:07:35 +13:00
checkmarc.tt
cities.tt Fix for Bug 6616 - Move common table pager markup to include 2011-10-09 20:07:35 +13:00
classsources.tt
clone-rules.tt Fix for Bug 6458 - incorrect parsing result in translation processing / clone-rules 2011-09-14 10:08:35 +12:00
currency.tt
fieldmapping.tt
item_circulation_alerts.tt
itemtypes.tt Fix for Bug 6616 - Move common table pager markup to include 2011-10-09 20:07:35 +13:00
koha2marclinks.tt
marc_subfields_structure.tt Previous and next functions are not used, since this code was removed from mas_subfields_structure.pl 2012-02-15 17:06:28 +01:00
marctagstructure.tt Fix for Bug 6616 - Move common table pager markup to include 2011-10-09 20:07:35 +13:00
matching-rules.tt Bug 6713, editing matching rules broken 2011-08-13 20:06:41 +12:00
patron-attr-types.tt Fixing a bug in the templates that will break translation 2011-09-24 20:54:42 +12:00
preferences.tt Bug 7645 - System preferences editor save button obscured by language chooser 2012-03-13 14:37:24 +01:00
printers.tt
roadtype.tt
smart-rules.tt Bug 6351: Cannot delete library-specific holds polices and checkout limits 2011-09-01 21:26:26 +12:00
stopwords.tt
systempreferences.tt Bug 7127 - Templates must be valid XHTML 2012-02-06 21:38:29 +01:00
z3950servers.tt Bug 7582 - When adding a Z39.50 server the "checked" option should use a checkbox 2012-02-27 18:33:12 +01:00