|
From: Raadush <ra...@gm...> - 2015-06-04 14:24:18
|
Hello. Im trying to use ejbca's web service interface, but when I try call
some method, I recieve "AuthorizationDeniedException_Exception: Error no
client certificate recieved used for authentication". I suppose I have to
add client certificate authorization somewhere, but got no idea how to. Can
somebody show me the right way of doing so? My simple class is here
(exception is thrown ar service.certificateRequest call. I also tired call
webservice through SoapUi only to get the very same exception):
public class EjbcConnector {
EjbcaWS service;
public EjbcConnector() {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(EjbcaWS.class);
factory.setAddress("http://localhost:8080/ejbca/ejbcaws/ejbcaws");
service = (EjbcaWS) factory.create();
}
public String certificateRequest(String certificate) throws Exception {
UserDataVOWS userData = new UserDataVOWS();
userData.setUsername("Test");
userData.setPassword("Test");
userData.setCaName("ManagementCA");
try {
CertificateResponse response =
service.certificateRequest(userData, certificate, 0, null, "CERTIFICATE");
return Base64.encodeBase64String(response.getData());
} catch (Exception ex) {
throw ex;
}
}
}
|