use of org.apache.cxf.systest.ws.common.UTPasswordCallback in project cxf by apache.
the class StaxServer method doPublish.
private void doPublish(String url, Object obj) {
Endpoint ep = Endpoint.create(obj);
ep.getProperties().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER + ".sct", new KeystorePasswordCallback());
ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct", "bob.properties");
if (url.contains("X10_I")) {
ep.getProperties().put(SecurityConstants.SIGNATURE_PROPERTIES + ".sct", "bob.properties");
ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct", "alice.properties");
} else if (url.contains("MutualCert")) {
ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct", "bob.properties");
ep.getProperties().put(SecurityConstants.SIGNATURE_PROPERTIES + ".sct", "alice.properties");
ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
} else if (url.contains("UserNameOverTransport")) {
ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER + ".sct", new UTPasswordCallback());
}
ep.publish(url);
}
use of org.apache.cxf.systest.ws.common.UTPasswordCallback in project cxf by apache.
the class Server method doPublish.
private void doPublish(String url, Object obj) {
Endpoint ep = Endpoint.create(obj);
ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER + ".sct", new KeystorePasswordCallback());
ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct", "bob.properties");
if (url.contains("X10_I")) {
ep.getProperties().put(SecurityConstants.SIGNATURE_PROPERTIES + ".sct", "bob.properties");
ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct", "alice.properties");
} else if (url.contains("MutualCert")) {
ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct", "bob.properties");
ep.getProperties().put(SecurityConstants.SIGNATURE_PROPERTIES + ".sct", "alice.properties");
ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
} else if (url.contains("UserNameOverTransport")) {
ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER + ".sct", new UTPasswordCallback());
}
ep.publish(url);
}
use of org.apache.cxf.systest.ws.common.UTPasswordCallback in project cxf by apache.
the class JavaFirstPolicyServiceTest method getPasswordProperties.
private Map<String, Object> getPasswordProperties(String username, String password) {
UTPasswordCallback callback = new UTPasswordCallback();
callback.setAliasPassword(username, password);
Map<String, Object> outProps = new HashMap<>();
outProps.put(ConfigurationConstants.ACTION, ConfigurationConstants.USERNAME_TOKEN);
outProps.put(ConfigurationConstants.PASSWORD_TYPE, WSS4JConstants.PW_TEXT);
outProps.put(ConfigurationConstants.PW_CALLBACK_REF, callback);
outProps.put(ConfigurationConstants.USER, username);
return outProps;
}
Aggregations