fritzy / hapi-sspi

Hapi auth for SSPI
MIT License
0 stars 2 forks source link

Server stuck with Basic Authentication #3

Open avitale opened 8 years ago

avitale commented 8 years ago

Hi and thanks for the great plugin! I am trying to make it work with Basic Authentication but the server gets stuck.

I am using the example on the readme with these plugin options

offerSSPI: false
offerBasic: true

The browser prompts for the authentication, then via console.log I can verify that the server authenticates the user and reaches the reply but the browser keeps waiting for a couple of minutes before receiving it or giving a timeout. If I use the options above in node-sspi standard example, the one with express, it works just fine. I tried investigating if it was something connected with node-sspi finishing the request outside of hapi request lifecycle but was not able to come up with a solution.

Any suggestion?

fritzy commented 8 years ago

Thanks @avitale. Do you mind doing some debugging?

On index.js in the package at line 32 https://github.com/fritzy/hapi-sspi/blob/master/index.js#L32 add a console.log(options) to see if the options is getting set the way you wanted.

Thanks!

fritzy commented 8 years ago

I don't have a windows machine to test at the moment. I suspect that !res.finished alternative being missing is a bad thing. Perhaps an else and a reply.continue() would be good there. I haven't tested with basic.

avitale commented 8 years ago

Thanks for answering! The options are set properly. I added the else for !res.finished and tried it with these 3 different statements alternatively

reply.continue();

reply.close({end:true});

reply.close({end:false});

Each of them results in an internal server error

Error: Can't set headers after they are sent.
fritzy commented 8 years ago

ok, thanks @avitale. I'll take a look in the next 3 days -- it's on my list and I'll spin up a windows vm.

simon-p-r commented 7 years ago

Any progress on this problem? I am trying to use basic authentication.