erlandranvinge / ntlm.js

Implementation of Microsoft NTLM in javascript. Allows you to do that NTLM ajax you've always wanted.
MIT License
51 stars 38 forks source link

Async #2

Closed pat-flew closed 8 years ago

pat-flew commented 9 years ago

Hi there! I was wondering if there is a reason why the auth requests are made synchronously rather than async? I am in a situation where I need to make the requests async so wondering if this is deliberate

erlandranvinge commented 9 years ago

Hi! Nope, not deliberate; more less random.

To give you a bit of background, this project was somewhat of a saturday-hack where I was learning the details of this ancient model of authentication while seeing if this was actually possible to reimplement it bottom-up. Most browsers have NTLM-challenge response builtin for "normal" HTTP-requests, but I hadn't seen it done with AJAX before. As time went by people started using it, especially developers stuck in an unforgiving domain (I'm looking at you random enterprise product with your own markup and no viable way of customisation except injecting javascript).

I haven't looked at the code in a while, but if I remember correctly it should be straight-forward to asyncify it by simply changing the XHR-requests to async and accepting a callback into the auth method. All PR:s are certainly welcome.