Hi,
There is still some work to be done on the code to tidy things up and I will also write some stuff for the documentation. I guess it's still in an "alpha" state. There is already an X.509 version of the contacts application which appeared to work OK but I need to generate a more appropriate set of certificates/keys for running it and add those to CVS. You can use the configuration there as a guideline for setting up your own web application.
I've only run the code in JBoss 3.2.7 so far (i.e. Tomcat 5.0). The server.xml configuration looks like this
Code:
<!-- SSL/TLS Connector configuration -->
<Connector port="8443" address="${jboss.bind.address}"
maxThreads="100" minSpareThreads="5" maxSpareThreads="15"
scheme="https" secure="true"
sslProtocol = "TLS"
clientAuth="want" keystoreFile="${jboss.server.home.dir}/conf/test.p12"
keystoreType="PKCS12" keystorePass="password"
truststoreFile="${jboss.server.home.dir}/conf/trust.p12"
truststoreType="PKCS12" truststorePass="password"
/>
Test.p12 contains my server certificate and key (signed by a test CA) and trust.p12 contains the CA certificate.
If you're comfortable messing about with openSSL and setting up server and client certificates then that is where most of the work is in getting things up and running.
To start with, set "clientAuth=true" on the connector and get normal certificate authentication working with the container. Then try adding your webapp, copying the configuration from the contacts example. The X509ProcessingFilter will just pick out the certificate from the request and use it as the credetials for Acegi's authentication.
http://acegisecurity.sourceforge.net...ref/index.html
Since we know the certificate is valid (the container has authenticated it), the main concern of the X509AuthenticationProvider
http://acegisecurity.sourceforge.net...nProvider.html
is mapping the client certificate to the user's GrantedAuthorities which can be by Acegi. This is done by configuring an X509AuthoritiesPopulator
http://acegisecurity.sourceforge.net...Populator.html
At the moment we have provided a Dao-based implementation but you can use any mechanism you want.
So feel free to give it a go if you want and let me know how you get on, or if you have any additional questions.
Any feedback regarding requirements or enhancements also is very welcome.
cheers,
Luke.