use of org.apache.wss4j.common.ext.WSPasswordCallback in project tesb-rt-se by Talend.
the class WSPasswordCallbackHandlerTest method handleEncryptedPasswordTest.
@Ignore
public void handleEncryptedPasswordTest() throws Exception {
String username = "username";
String password = PropertyValueEncryptionUtils.encrypt("password", getEncryptor());
WSPasswordCallbackHandler h = new WSPasswordCallbackHandler(username, password);
Callback c = new WSPasswordCallback(username, 0);
List<Callback> cs = new ArrayList<Callback>();
cs.add(c);
h.handle(cs.toArray(new Callback[0]));
}
use of org.apache.wss4j.common.ext.WSPasswordCallback in project tesb-rt-se by Talend.
the class WSPasswordCallbackHandlerTest method handleNoUserTest.
@Test
public void handleNoUserTest() throws Exception {
String username = null;
String password = "password";
WSPasswordCallbackHandler h = new WSPasswordCallbackHandler(username, password);
Callback c = new WSPasswordCallback(username, 0);
List<Callback> cs = new ArrayList<Callback>();
cs.add(c);
h.handle(cs.toArray(new Callback[0]));
}
use of org.apache.wss4j.common.ext.WSPasswordCallback in project tesb-rt-se by Talend.
the class PasswordCallbackHandlerTest method testPasswordCallbackHandlerNotCorrectIdentifier.
@Test
public void testPasswordCallbackHandlerNotCorrectIdentifier() throws Exception {
PasswordCallbackHandler handler = new PasswordCallbackHandler();
List<Callback> callbacksList = new ArrayList<Callback>();
WSPasswordCallback callback = new WSPasswordCallback("id", 0);
callback.setIdentifier("notMystskey");
callbacksList.add(callback);
handler.handle(callbacksList.toArray(new Callback[callbacksList.size()]));
Assert.assertNull(callback.getPassword());
}
use of org.apache.wss4j.common.ext.WSPasswordCallback in project tesb-rt-se by Talend.
the class PasswordCallbackHandlerTest method testPasswordCallbackHandler.
@Test
public void testPasswordCallbackHandler() throws Exception {
PasswordCallbackHandler handler = new PasswordCallbackHandler();
List<Callback> callbacksList = new ArrayList<Callback>();
WSPasswordCallback callback = new WSPasswordCallback("id", 0);
callback.setIdentifier("mystskey");
callbacksList.add(callback);
handler.handle(callbacksList.toArray(new Callback[callbacksList.size()]));
assertSame("stskpass", callback.getPassword());
}
use of org.apache.wss4j.common.ext.WSPasswordCallback in project tesb-rt-se by Talend.
the class PasswordCallbackHandlerTest method testPasswordCallbackHandlerNotCorrectIdentifier.
@Test
public void testPasswordCallbackHandlerNotCorrectIdentifier() throws Exception {
PasswordCallbackHandler handler = new PasswordCallbackHandler();
List<Callback> callbacksList = new ArrayList<Callback>();
WSPasswordCallback callback = new WSPasswordCallback("id", 0);
callback.setIdentifier("notMystskey");
callbacksList.add(callback);
handler.handle(callbacksList.toArray(new Callback[callbacksList.size()]));
Assert.assertNull(callback.getPassword());
}
Aggregations