Search in sources :

Example 1 with NTLMEngineException

use of org.apache.http.impl.auth.NTLMEngineException in project fess-crawler by codelibs.

the class JcifsEngine method generateType3Msg.

@Override
public String generateType3Msg(final String username, final String password, final String domain, final String workstation, final String challenge) throws NTLMEngineException {
    Type2Message type2Message;
    try {
        type2Message = new Type2Message(Base64.decode(challenge));
    } catch (final IOException exception) {
        throw new NTLMEngineException("Invalid NTLM type 2 message", exception);
    }
    final int type2Flags = type2Message.getFlags();
    final int type3Flags = type2Flags & (0xffffffff ^ (NtlmFlags.NTLMSSP_TARGET_TYPE_DOMAIN | NtlmFlags.NTLMSSP_TARGET_TYPE_SERVER));
    final Type3Message type3Message = new Type3Message(type2Message, password, domain, username, workstation, type3Flags);
    return Base64.encode(type3Message.toByteArray());
}
Also used : IOException(java.io.IOException) NTLMEngineException(org.apache.http.impl.auth.NTLMEngineException) Type2Message(jcifs.ntlmssp.Type2Message) Type3Message(jcifs.ntlmssp.Type3Message)

Aggregations

IOException (java.io.IOException)1 Type2Message (jcifs.ntlmssp.Type2Message)1 Type3Message (jcifs.ntlmssp.Type3Message)1 NTLMEngineException (org.apache.http.impl.auth.NTLMEngineException)1