开发者

How to organize X509 authentication in web application with Java and Spring?

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 c开发者_运维知识库an 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.

P.P.S. And sorry for my language - it isn't my native one.


I am not familiar with Spring but the documentation indicates:

You should be familiar with using certificates and setting up client authentication for your servlet container before attempting to use it with Spring Security. Most of the work is in creating and installing suitable certificates and keys. For example, if you're using Tomcat then read the instructions here http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html. It's important that you get this working before trying it out with Spring Security

First of all I think you have to setup X509 authentication in your JBoss servlet container.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜