HttpAuthenticationRequestFilter extends AbstractRequestFilter { @Override public void filterAbstractHttpRequest(SubmitContext context, AbstractHttpRequest<?> wsdlRequest) { String username = PropertyExpander.expandProperties(context, wsdlRequest.getUsername()); if (username == null || username.length() == 0) { return; } Settings settings = wsdlRequest.getSettings(); String password = PropertyExpander.expandProperties(context, wsdlRequest.getPassword()); String domain = PropertyExpander.expandProperties(context, wsdlRequest.getDomain()); Enum authType = Enum.forString(wsdlRequest.getAuthType()); String wssPasswordType = null; if (wsdlRequest instanceof WsdlRequest) { wssPasswordType = PropertyExpander.expandProperties(context, ((WsdlRequest) wsdlRequest).getWssPasswordType()); } if (StringUtils.isNullOrEmpty(wssPasswordType)) { initRequestCredentials(context, username, settings, password, domain, authType); } }  @Override void filterAbstractHttpRequest(SubmitContext context, AbstractHttpRequest<?> wsdlRequest); static void initRequestCredentials(SubmitContext context, String username, Settings settings,
                                              String password, String domain, Enum authType);  }
@Test public void selectingAuthTypeNtlmReturnsNtlmIfNtlmRequested() { selectAuthMethod(CredentialsConfig.AuthType.NTLM); filter.filterAbstractHttpRequest(null, wsdlRequest); AuthScheme scheme = getSchemeFor(AuthPolicy.NTLM); assertThat(scheme, instanceOf(NTLMScheme.class)); }
@Test public void selectingAuthTypeSpnegoReturnsSpnegoIfSpnegoRequested() { selectAuthMethod(CredentialsConfig.AuthType.SPNEGO_KERBEROS); filter.filterAbstractHttpRequest(null, wsdlRequest); AuthScheme scheme = getSchemeFor(AuthPolicy.SPNEGO); assertThat(scheme, instanceOf(SPNegoScheme.class)); }
@Test public void selectingAuthTypeSpnegoReturnsNtlmIfNtlmRequested() { selectAuthMethod(CredentialsConfig.AuthType.SPNEGO_KERBEROS); filter.filterAbstractHttpRequest(null, wsdlRequest); AuthScheme scheme = getSchemeFor(AuthPolicy.NTLM); assertThat(scheme, instanceOf(NTLMScheme.class)); }