Changeset 1118


Ignore:
Timestamp:
2009-03-05 13:09:02 (4 years ago)
Author:
bruno
Message:

Security: add an authentication mechanism for Belgian eID.

  • Since this is just a case of ssl client authentication, it is essentially a matter of web server configuration and redirecting to a https URL. To make it somewhat nicer, before redirecting you can optionally show a page to the user.
  • To map the certificate to a user (principal) in your application, an BelgianEidPrincipalExtractor? interface is available.
  • Added a sample to kauri-security-sample, which should be readily usable as the HTTPS connector is enabled for this sample, and a keystore with a self-signed certificate for "localhost" is included. The keystore also contains the Belgium Root CA/CA2 certificates.

TODO:

  • checking of certificates for revocation (note that since the authentication mechanism runs on each request, there should be some caching applied)
  • see if it is possible to make this work with the Fedict's 'authentication reverse proxy' too
  • a limitation of HTTPS with Jetty (possibly Java?) is that you can only enable client certification for the complete domain:port, and not for subpaths within it.
Location:
trunk
Files:
8 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-security/kauri-security-providers/pom.xml

    r1100 r1118  
    2424      <groupId>org.kauriproject</groupId> 
    2525      <artifactId>kauri-security-api</artifactId> 
     26    </dependency> 
     27    <dependency> 
     28      <groupId>org.kauriproject</groupId> 
     29      <artifactId>kauri-restlet-util</artifactId> 
    2630    </dependency> 
    2731    <dependency> 
  • trunk/samples/kauri-security-sample/conf/security/auth.xml

    r1109 r1118  
    7373    </realm> 
    7474 
     75    <!-- Belgian eID sample --> 
     76    <realm name="realm6"> 
     77      <authenticationMechanisms> 
     78        <authenticationMechanism moduleId="samples.security" beanId="beidAuthMechanism"/> 
     79      </authenticationMechanisms> 
     80      <authenticationManager moduleId="samples.security" beanId="authenticationManager"/> 
     81      <accessDecisionManager moduleId="samples.security" beanId="accessDecisionManager"/> 
     82      <protect module="samples.security" restservice="main"> 
     83        <protect path="/realm6/**" access="ROLE_USER"/> 
     84      </protect> 
     85    </realm> 
     86 
    7587  </realms> 
    7688</auth> 
  • trunk/samples/kauri-security-sample/src/main/kauri/pages/index.html.xml

    r1116 r1118  
    8383      <li><a href="logout2">Logout (from realm 5)</a></li> 
    8484    </ul> 
     85 
     86    <h3>Realm 6: Belgian eID</h3> 
     87 
     88    <p>Illustrates Belgian eID authentication, which is a case of https with client certificates, 
     89      whereby the user's private key is stored on a smart card.</p> 
     90 
     91    <p>To use this sample, you need to have a Belgian eID card, a smart cart reader, and 
     92      <a href="http://eid.belgium.be">follow the installation instructions</a>. You will need 
     93    to accept the server's (= localhost) self-signed certificate.</p> 
     94 
     95    <ul> 
     96      <li><a href="realm6/eid.html">eID protected page</a></li> 
     97    </ul> 
    8598  </t:block> 
    8699</html> 
  • trunk/samples/kauri-security-sample/src/main/kauri/spring/services.xml

    r1115 r1118  
    138138  </bean> 
    139139 
     140  <bean id="beidAuthMechanism" class="org.kauriproject.security.providers.BelgianEidAuthenticationMechanism"> 
     141    <property name="principalExtractor" ref="beidPrincipalExtractor"/> 
     142    <property name="httpsPort" value="8443"/> <!-- See also the port number in connectors.xml --> 
     143    <property name="challengePage" value="service:/main/belgian_eid_infopage.html"/> 
     144    <property name="restletContext" ref="restletContext"/> 
     145  </bean> 
     146 
     147  <bean id="beidPrincipalExtractor" class="org.kauriproject.samples.security.SampleBelgianEidPrincipalExtractor"/> 
     148 
    140149</beans> 
Note: See TracChangeset for help on using the changeset viewer.