Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added keep alive property #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

einfallstoll
Copy link
Owner

Fixes authentication is null issue mentioned.

Does this really help? This could fix #22 and #20?

Fixes authentication is null issue mentioned; https://github.com/einfallstoll/express-ntlm
@einfallstoll
Copy link
Owner Author

@emileindik Could you share your experience with this change? I would love to get this merged at some point.

@NareikQ
Copy link

NareikQ commented Jun 17, 2019

I tested this in an intranet enviroment and got the same results as the main branch. When multiple users try to access the site, sometimes the credentials get mixed up.

Here is my implementation code:

router.use(
  ntlm({
    debug: function() {
      let args = Array.prototype.slice.apply(arguments);
      console.log.apply(null, args);
    },
    domain: "MS",
    domaincontroller: "ldap://ldap.company.com"
  })
);

router.get("/", (req, res) => {
  let  sAMAccountName = req.ntlm.UserName;
  console.log("sAMAccountName", sAMAccountName);
});

I call the route when the page loads with this:

axios({
  method: 'GET',
  url: url,
  mode: 'cors',
  withCredentials: true
  })
    .then(response => {
      console.log('Data', response.data);
    })
    .catch(err => {
      console.log(err.response);
 });

These are examples of the logs:

[express-ntlm] No Authorization header present
[express-ntlm] Connection already authenticated MS/kquinn
{ level: '\u001b[31merror\u001b[39m',
message: 'Cannot read property 'authenticate' of nullCannot read property 'authenticate' of null',
stack: 'TypeError: Cannot read property 'authenticate' of null\n at handle_type3 (C:\home\site\wwwroot\node_modules\express-ntlm\lib\express-ntlm.js:169:14)\n at C:\home\site\wwwroot\node_modules\express-ntlm\lib\express-ntlm.js:246:24\n at Layer.handle [as handle_request] (C:\home\site\wwwroot\node_modules\express\lib\router\layer.js:95:5)\n at trim_prefix (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:317:13)\n at C:\home\site\wwwroot\node_modules\express\lib\router\index.js:284:7\n at Function.process_params (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:335:12)\n at next (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:275:10)\n at Function.handle (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:174:3)\n at router (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:47:12)\n at Layer.handle [as handle_request] (C:\home\site\wwwroot\node_modules\express\lib\router\layer.js:95:5)\n at trim_prefix (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:317:13)\n at C:\home\site\wwwroot\node_modules\express\lib\router\index.js:284:7\n at Function.process_params (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:335:12)\n at next (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:275:10)\n at jsonParser (C:\home\site\wwwroot\node_modules\body-parser\lib\types\json.js:119:7)\n at Layer.handle [as handle_request] (C:\home\site\wwwroot\node_modules\express\lib\router\layer.js:95:5)\n at trim_prefix (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:317:13)\n at C:\home\site\wwwroot\node_modules\express\lib\router\index.js:284:7\n at Function.process_params (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:335:12)\n at next (C:\home\site\wwwroot\node_modules\express\lib\router\index.js:275:10)\n at cors (C:\home\site\wwwroot\node_modules\cors\lib\index.js:188:7)\n at C:\home\site\wwwroot\node_modules\cors\lib\index.js:224:17' }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting logged in as another user
4 participants