How to organize X509 authentication in web application with Java and Spring?
posted 5 years ago
I have USB token with private key and X509 certificate on it. It can be seen from Firefox so it is OK. I have sample application from Spring Security (I'm using version 3), which just demonstrates different types of authentication. That app was deployed on JBoss AS 6. I've searched many forums and articles for info, how to use X509 cert instead of using login/pass auth (Example: x509 authentication with spring security 2.0.4). Everywhere i've seen: "Just add x509 tag in your applicationContext.xml", "Oh, thanks! It works!". There is x509 fragment in sample app from Spring Security in applicationContext.xml which was commented. I've uncommented that stuff, but nothing works. That app logs all actions, so I can see, that X509 filter is firing when I load an app page, but it does nothing, because it writes in log: "No certificate found in user request".
Can you help me with that problem? Should Spring get CN from certificate from browser and use it instead of login name? What do I do wrong?
P.S. I have right user service block in applicationContext.xml. It works with standart login/pass form.
P.P.S. And sorry for my language - it isn't my native one.