0

I want to authenticate against a board game website called yucata.de using nodejs.

Via Python

Looking at the headers with Chrome devtools, it looks like it uses a ASP.NET_SessionId, a .Stackify.Run, and a 168 hex value for Yucata inside of its cookie, with content type multipart/form-data; boundary=----WebKitFormBoundary. Given the ASP.NET component, I tried using python's NTLM library, and it works with the example code given on the main page of requests_ntlm:

import requests
from requests_ntlm import HttpNtlmAuth

requests.get("http://www.yucata.de/en/Overview",
              auth=HttpNtlmAuth(f'domain\\{user}',
              password
))

Overview here is a route that requires authentication.

Attempts with node and httpntlm

Using the example code for httpntlm, I get a 401:

var httpntlm = require('httpntlm');

httpntlm.get({
    url: "https://www.yucata.de",
    username: 'user',
    password: 'password',
    workstation: 'yucata',
    domain: 'www.yucata.de'
}, function (err, res){
    if(err) return err;

    console.log(res.headers);
    console.log(res.body);
});

The title (combined with an h3) of the response is

401 - Nicht autorisiert: Zugriff aufgrund ung�ltiger Anmeldeinformationen verweigert. Die angegebenen Anmeldeinformationen berechtigen Sie nicht, dieses Verzeichnis oder diese Seite anzuzeigen.

Which, translated to English via google translate, is

401 - Unauthorized: Access denied due to invalid credentials. The credentials provided do not authorize you to view this directory or this page.

I would think that the code above would work as httpntlm is a port of the python library. I have double checked that the username and password are the same in both code snippets.

Question

Why do I get a 401 with httpntlm using domain, user, pass when it's possible to use the library it's ported from, requests_ntlm, with the same values?

4

0 回答 0