use of org.codice.ddf.security.common.FailedLoginDelayer in project ddf by codice.
the class TestUsernameTokenValidator method setup.
@Before
public void setup() {
try {
Credential credential = mock(Credential.class);
when(niceValidator.validate(any(Credential.class), any(RequestData.class))).thenReturn(credential);
} catch (WSSecurityException ignore) {
//do nothing
}
failedLoginDelayer = mock(FailedLoginDelayer.class);
}
use of org.codice.ddf.security.common.FailedLoginDelayer in project ddf by codice.
the class UPBSTValidatorTest method setup.
@Before
public void setup() {
niceValidator.setContextName("realm");
meanValidator.setContextName("realm");
stsPropertiesMBean = mock(STSPropertiesMBean.class);
when(stsPropertiesMBean.getSignatureCrypto()).thenReturn(new Merlin());
when(stsPropertiesMBean.getCallbackHandler()).thenReturn(callbacks -> {
});
UPAuthenticationToken upAuthenticationToken = new UPAuthenticationToken("good", "password", "realm");
BinarySecurityTokenType binarySecurityTokenType = new BinarySecurityTokenType();
binarySecurityTokenType.setValueType(UPAuthenticationToken.UP_TOKEN_VALUE_TYPE);
binarySecurityTokenType.setEncodingType(BSTAuthenticationToken.BASE64_ENCODING);
binarySecurityTokenType.setId(UPAuthenticationToken.BST_USERNAME_LN);
binarySecurityTokenType.setValue(upAuthenticationToken.getEncodedCredentials());
upbstToken = new JAXBElement<>(new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "BinarySecurityToken"), BinarySecurityTokenType.class, binarySecurityTokenType);
failedLoginDelayer = mock(FailedLoginDelayer.class);
}
Aggregations