How to use the httpntlm/ntlm.createType3Message function in httpntlm

To help you get started, we’ve selected a few httpntlm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nodemailer / smtp-connection / lib / smtp-connection.js View on Github external
if (!challengeMatch) {
            return callback(this._formatError('Invalid login sequence while waiting for server challenge string', 'EAUTH', str, 'AUTH NTLM'));
        } else {
            challengeString = challengeMatch[1];
        }

        if (!/^NTLM/i.test(challengeString)) {
            challengeString = 'NTLM ' + challengeString;
        }

        let type2Message = ntlm.parseType2Message(challengeString, callback);
        if (!type2Message) {
            return;
        }

        let type3Message = ntlm.createType3Message(type2Message, {
            domain: this._auth.domain || '',
            workstation: this._auth.workstation || '',
            username: this._auth.user,
            password: this._auth.pass
        });

        type3Message = type3Message.substring(5); // remove the "NTLM " prefix

        this._responseActions.push(str => {
            this._actionAUTH_NTLM_TYPE3(str, callback);
        });

        this._sendCommand(type3Message);
    }
github Hanul / YourServerNowHot / BOX / UMAIL / node_modules / nodemailer / node_modules / smtp-connection / lib / smtp-connection.js View on Github external
if (!challengeMatch) {
        return callback(this._formatError('Invalid login sequence while waiting for server challenge string', 'EAUTH', str, 'AUTH NTLM'));
    } else {
        challengeString = challengeMatch[1];
    }

    if (!/^NTLM/i.test(challengeString)) {
        challengeString = 'NTLM ' + challengeString;
    }

    var type2Message = ntlm.parseType2Message(challengeString, callback);
    if (!type2Message) {
        return;
    }

    var type3Message = ntlm.createType3Message(type2Message, {
        domain: this._auth.domain || '',
        workstation: this._auth.workstation || '',
        username: this._auth.user,
        password: this._auth.pass
    });

    type3Message = type3Message.substring(5); // remove the "NTLM " prefix

    this._responseActions.push(function (str) {
        this._actionAUTH_NTLM_TYPE3(str, callback);
    }.bind(this));

    this._sendCommand(type3Message);
};