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

Windows integrated auth draft #486

Closed

Conversation

tvrprasad
Copy link
Contributor

@arthurschreiber I believe this is close to final form. Can I get some early feedback please? I just want to make sure I'm on track here. CI tests will fail as I don't have sspi-client package published yet.

I tested this locally, opened 1600 simultaneous connections and sent queries to two different machines. Works just fine. You can see the simple test at - https://github.com/tvrprasad/sspi-client/blob/master/integration/sqlconnect-stress.js

If you got time to make another pass at https://github.com/tvrprasad/sspi-client, that'd be great. Got some more work before I can publish the npm package.

@arobson FYI. I'm able to take advantage of all the work done for password based NTLM support. I welcome any feedback.

I'm very much looking forward to getting this in :-)

Bug fix: When clientResponse length from getNextBlob() is 0, that
indicates server is done with authentication and start sending data.
The old code was switching to SENT_NTLM_RESPONSE asynchronously,
this was causing problems when the server data comes too soon. Fix is
to switch to SENT_NTLM_RESPONSE synchronously. This is safe as server
should not be sending data unless it's done with authentication on
it's end.

There is an extra round trip involved in authentication process with
NTLM vs Kerberos.
npm install for these versions is failing due to a bug that causes
installation of native modules to fail with the error:
C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34):
error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers
[C:\projects\tedious\node_modules\sspi-client\build\sspi-client.vcxproj]

This seems to be a known issue with certain npm/node-gyp versions:
nodejs/node-gyp#972
nodejs/node#7286

Fixing this by installing the latest version of npm before running the
tests.
tvrprasad added a commit to tvrprasad/tedious that referenced this pull request Feb 1, 2017
Status of various versions of node may be seen at:
https://github.com/nodejs/LTS

Per that, versions v0.10, v0.12 and v5 fell out of maintenance mode. It
might make sense drop support for these versions for future releases of
Tedious.

Specific motivation for this is the Windows Integrated Authentication
work which has test failures due to bugs in those versions, and forcing a
hacky work-around that requires installing latest version of npm before
running the tests for each version of nodejs. See:
tediousjs@15a52b7

This part of this PR: tediousjs#486
tvrprasad added a commit to tvrprasad/tedious that referenced this pull request Feb 2, 2017
- This is currently implemented for Windows only.
- No username/password needed when connecting as domain user.
- Leverages current implementation of NTLM authentication that requires
  username/password.
- Adds a dependency on https://www.npmjs.com/package/sspi-client package
  for implementation of SSPI protocol.
- sspi-client has native code which means the module will be built on
  client machines at Tedious installation time.

Address issue - tediousjs#415

This is a squashed version of the work done under
tediousjs#486
@tvrprasad
Copy link
Contributor Author

Opened a PR without the 'draft' at the end, which makes it real :)
Please review and give feedback here:
#497

@tvrprasad tvrprasad closed this Feb 2, 2017
@sanjeev2315
Copy link

will it support window based auth without password on Linux

@tvrprasad
Copy link
Contributor Author

@sanjeev2315 This only works on Windows. I plan to add Linux support after this gets merged. I closed this PR in favor of #497, please track that.

tvrprasad added a commit to tvrprasad/tedious that referenced this pull request May 17, 2017
- This is currently implemented for Windows only.
- No username/password needed when connecting as domain user.
- Leverages current implementation of NTLM authentication that requires
  username/password.
- Adds a dependency on https://www.npmjs.com/package/sspi-client package
  for implementation of SSPI protocol.
- sspi-client has native code which means the module will be built on
  client machines at Tedious installation time.

Address issue - tediousjs#415

This is a squashed version of the work done under
tediousjs#486
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.

None yet

2 participants