lib/DAV/plugins/auth/abstractDigest.js
function(handler, realm, cbauth) {
        var req = handler.httpRequest;
        this.init(realm, req);

        var username = this.digestParts["username"];
        // No username was given
        if (!username)
            return this.requireAuth(realm, "No digest authentication headers were found", cbauth);

        var self = this;
        this.getDigestHash(realm, username, function(err, hash) {
            // If this was false, the user account didn't exist
            if (err || !hash)
                return self.requireAuth(realm, err || "The supplied username was not on file", cbauth);

            if (typeof hash != "string") {
                handler.handleError(new Exc.jsDAV_Exception(
                    "The returned value from getDigestHash must be a string or null"));
                return cbauth(null, false);
            }

            // If this was false, the password or part of the hash was incorrect.
            self.validateA1(handler, hash, function(isValid) {
                if (!isValid)
                    return self.requireAuth(realm, "Incorrect username", cbauth);

                self.currentUser = username;
                cbauth(null, true);
            });
        });
    }
function(handler, realm, cbauth) {
        var req = handler.httpRequest;
        this.init(realm, req);

        var username = this.digestParts["username"];
        // No username was given
        if (!username)
            return this.requireAuth(realm, "No digest authentication headers were found", cbauth);

        var self = this;
        this.getDigestHash(realm, username, function(err, hash) {
            // If this was false, the user account didn't exist
            if (err || !hash)
                return self.requireAuth(realm, err || "The supplied username was not on file", cbauth);

            if (typeof hash != "string") {
                handler.handleError(new Exc.jsDAV_Exception(
                    "The returned value from getDigestHash must be a string or null"));
                return cbauth(null, false);
            }

            // If this was false, the password or part of the hash was incorrect.
            self.validateA1(handler, hash, function(isValid) {
                if (!isValid)
                    return self.requireAuth(realm, "Incorrect username", cbauth);

                self.currentUser = username;
                cbauth(null, true);
            });
        });
    }
function ( handler , realm , cbauth ) { var req = handler . httpRequest ; this . init ( realm , req ) ; var username = this . digestParts [ "username" ] ; // No username was given if ( ! username ) return this . requireAuth ( realm , "No digest authentication headers were found" , cbauth ) ; var self = this ; this . getDigestHash ( realm , username , function ( err , hash ) { // If this was false, the user account didn't exist if ( err || ! hash ) return self . requireAuth ( realm , err || "The supplied username was not on file" , cbauth ) ; if ( typeof hash != "string" ) { handler . handleError ( new Exc . jsDAV_Exception ( "The returned value from getDigestHash must be a string or null" ) ) ; return cbauth ( null , false ) ; } // If this was false, the password or part of the hash was incorrect. self . validateA1 ( handler , hash , function ( isValid ) { if ( ! isValid ) return self . requireAuth ( realm , "Incorrect username" , cbauth ) ; self . currentUser = username ; cbauth ( null , true ) ; } ) ; } ) ; }
Authenticates the user based on the current request.

If authentication is succesful, true must be returned.
If authentication fails, an exception must be thrown.

@throws Sabre_DAV_Exception_NotAuthenticated
@return bool
Authenticates the user based on the current request .