Search in sources :

Example 1 with UTPasswordCallback

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);
}
Also used : Endpoint(javax.xml.ws.Endpoint) UTPasswordCallback(org.apache.cxf.systest.ws.common.UTPasswordCallback) KeystorePasswordCallback(org.apache.cxf.systest.ws.common.KeystorePasswordCallback)

Example 2 with UTPasswordCallback

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);
}
Also used : Endpoint(javax.xml.ws.Endpoint) UTPasswordCallback(org.apache.cxf.systest.ws.common.UTPasswordCallback) KeystorePasswordCallback(org.apache.cxf.systest.ws.common.KeystorePasswordCallback)

Example 3 with UTPasswordCallback

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;
}
Also used : HashMap(java.util.HashMap) UTPasswordCallback(org.apache.cxf.systest.ws.common.UTPasswordCallback)

Aggregations

UTPasswordCallback (org.apache.cxf.systest.ws.common.UTPasswordCallback)3 Endpoint (javax.xml.ws.Endpoint)2 KeystorePasswordCallback (org.apache.cxf.systest.ws.common.KeystorePasswordCallback)2 HashMap (java.util.HashMap)1