String username, String password, String host, String domain)
throws AuthenticationException {
final String response;
if (message == null || message.trim().equals("")) {
Type1Message t1m = new Type1Message();
t1m.setSuppliedDomain(domain);
t1m.setSuppliedWorkstation(host);
/*
* Following constants provided by JCIFS library has been added to support message integrity,
* confidentiality, session security and 128-bit encryption
*/
t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SIGN,true);
t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SEAL,true);
t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_NTLM2,true);
t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_128,true);
return EncodingUtil.getAsciiString(Base64.encodeBase64(t1m.toByteArray()));
} else {
try
{
Type2Message t2m = parseType2Message(message);