Is it possible to use Windows integrated auth with

2019-04-26 21:59发布

问题:

I have an nginx reverse proxy to a few node apps. Our users are all on a Windows domain controlled network. I'm aware I can use express-ntlm or passport-windowsauth to prompt the user for their login credentials, but that's non-integrated auth.

Is it possible to use integrated auth (windows authenticated users can bypass credentials prompt) directly from within node.js (or nginx) without IIS (or Apache)? If so, how?

I suppose we could replace nginx with IIS as the reverse proxy, but I'd like to avoid that if I can.

回答1:

Yes, you can, there is a package called node-sspi. It only works on Windows environment though.

Windows SSPI server-side authentication for Node

NodeSSPI to Node.js is what mod-auth-sspi to Apache HTTPD. In a nutshell NodeSSPI authenticates incoming HTTP(S) requests through native Windows SSPI, hence NodeSSPI runs on Windows only.

If you need to use it for other OS, you need to develop your own node module or use Apache.