[jboss-user] [JBossWS] - Re: Retrieving alias for WS Secure client
kaprys
do-not-reply at jboss.com
Sun Nov 4 15:56:27 EST 2007
Hi,
I'm having very identical problem. I would like to authenticate the connecion with webservice using x509 certificate. Many clients will connect to webservice. Every client will have their own certificate. Webservice should recognize with client is connecting to him after getting the name from certificate.
And here I have two problems. First problem is that I really don't know whether I configure the authentication to webservice in a good way.
And the second problem is that I don't know how to get then certificate from MessageContext.
I found such example:
@Resource
WebServiceContext ctx;
...
MessageContext msg = ctx.getMessageContext();
HttpServletRequest req = (HttpServletRequest) msg.get(MessageContext.SERVLET_REQUEST);
X509Certificate[] certificates = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate");
if (certificates != null) {
X509Certificate cert = certificates[0];
Principal clientDN = cert.getSubjectDN();
String name = clientDN.getName()
}
And every time certificates is null.
Could anybody help me??
Maybe you know any tutorial where is shown how to configure the webservice to make a authentication via certificate because I don't have any idea what to do :(
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101614#4101614
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101614
More information about the jboss-user
mailing list