{"_id":"sspi-client","_rev":"2994199","name":"sspi-client","description":"SSPI Client Library.","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"prasadt","email":""}],"time":{"modified":"2023-08-28T09:19:20.000Z","created":"2017-01-31T00:23:48.714Z","0.1.0":"2017-01-31T00:23:48.714Z"},"users":{},"author":{"name":"Prasad Tammana","email":"prasadgithub@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/tvrprasad/sspi-client.git"},"versions":{"0.1.0":{"name":"sspi-client","version":"0.1.0","description":"SSPI Client Library.","author":{"name":"Prasad Tammana","email":"prasadgithub@gmail.com"},"license":"MIT","keywords":["sspi","tedious"],"homepage":"https://github.com/tvrprasad/sspi-client","bugs":{"url":"https://github.com/tvrprasad/sspi-client/issues"},"repository":{"type":"git","url":"git+https://github.com/tvrprasad/sspi-client.git"},"main":"src_js/index.js","dependencies":{"bindings":"^1.2.1","nan":"^2.5.1","semver":"^5.3.0"},"devDependencies":{"nodeunit":"^0.10.2"},"scripts":{"test":"nodeunit --reporter minimal test/unit/","install":"node-gyp rebuild"},"gypfile":true,"gitHead":"334f400ca8508bb4ed31352e17e079e2b0bf7ced","_id":"sspi-client@0.1.0","_shasum":"acfc5d19afcd5fcc880ff236171dfe96ad128cb4","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.2.1","_npmUser":{"name":"prasadt","email":"prasadgithub@gmail.com"},"dist":{"shasum":"acfc5d19afcd5fcc880ff236171dfe96ad128cb4","size":23572,"noattachment":false,"key":"/sspi-client/-/sspi-client-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sspi-client/download/sspi-client-0.1.0.tgz"},"maintainers":[{"name":"prasadt","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sspi-client-0.1.0.tgz_1485822226789_0.9846280622296035"},"directories":{},"publish_time":1485822228714,"_hasShrinkwrap":false,"_cnpm_publish_time":1485822228714,"_cnpmcore_publish_time":"2021-12-16T15:42:25.860Z","hasInstallScript":true}},"readme":"# Client Side SSPI Authentication Module.\n\n## Overview\nSSPI is a Microsoft specific API that may be used by applications for\nauthenticated communications. This allows an application to use various\navailable security modules without changing the interface to the security\nsystem. The actual security model is implemented by security packages installed\non the system. For more information, see [SSPI][].\n\nWindows implementation of SSPI is in native code, making it available only for\nC/C++ applications. sspi-client module provides a JavaScript interface for\napplications that need to communicate with a server using SSPI. Primary\nmotivitation for building this module is to help implement Windows Integrated\nAuthentication in [Tedious][].\n\n## API Documentation\nBelow is the API listing with brief optional descriptions. Refer to comments on\nthe corresponding functions and classes in code.\n### sspi_client\n#### SspiClient Class\nThis class has the core functionality implemented by the module.\n##### constructor\n```JavaScript\nvar sspiClient = new SspiClientApi.SspiClient(spn, securityPackage);\n````\nYou may get __spn__ by invoking <code>makeSpn()</code> which takes an FQDN. If\nyou only have simple hostname or IP address, you may get FQDN by invoking\n<code>getFqdn()</code> and then pass it to makeSpn.\n##### getNextBlob\n```JavaScript\nSspiClient.getNextBlob(serverResponse, serverResponseBeginOffset, serverResponseLength, cb)\n```\nThis function takes the server response and makes SSPI calls to get the client\nresponse to send back to the server. You can use just this function to\nimplement client side SSPI based authentication. This will do initialization\nif needed.\n#### ensureInitialization\n```JavaScript\nensureInitialization(cb);\n```\nDo initialization if needed.\n#### getAvailableSspiPackageNames\n```JavaScript\nvar availableSspiPackageNames = getAvailableSspiPackageNames();\n```\nInitialization must be completed before this function may be invoked.\n#### getDefaultSspiPackageName\n```JavaScript\nvar defaultPackageName = getDefaultSspiPackageName();\n```\nInitialization must be completed before this function may be invoked.\n#### enableNativeDebugLogging\n```JavaScript\nenableNativeDebugging();\n```\nLogs detailed debug information from native code.\n#### disableNativeDebugLogging\n```JavaScript\ndisableNativeDebugLogging();\n```\nThis together with <code>enableNativeDebugging</code> allows for enabling debug\nlogging for targeted sections of the application.\n### fqdn\n#### getFqdn\n```JavaScript\ngetFqdn(hostidentifier, cb);\n```\nResolves an IP address or hostname to an FQDN.\n### make_spn\n#### makeSpn\n```JavaScript\nvar spn = makeSpn(serviceClassName, fqdn, instanceNameOrPort;\n```\nPuts together the parameters passed in return the Service Principal Name.\n## Sample code\nFor a complete sample, see [Sample Code][].\n## Developer Notes\nThis section has notes for developers to be able to build and run tests.\n### Setup and Build\nInstall [NodeJS][]. Duh!  \n<code>npm install -g node-gyp</code>  \ngit clone https://github.com/tvrprasad/sspi-client.git  \ncd sspi-client  \nnpm install\n### Run Tests\n#### Setup\nCopy [test_config.json][] to %USERPROFILE%\\.sspi-client\\test_config.json  \nTweak the values in the file to have the right values for yoursetup. Should be\nself-explanatory.  This setup is needed for running both unit and integration\ntests.\n#### Unit Tests\nnpm run-script test\n#### Integration Tests\nIntegration tests are currently manual but hopefully not too tedious. They test\nthe functionality end to end. These tests are in the directory\ntest\\integration.\n##### sspi_client_test.js\nThis test sets up a SSPI server and runs SSPI client to connect with it.\nFollow instructions in [README_sspi_client_test.md][] to run this test.\n##### sqlconnect_windows_integrated_auth.js\nThis test validates integration with Tedious by attempting to connect and run a\nsimple query for the following matrix:\n1. Two instances of SQL Server, one local and one remote.\n2. Supported SSPI protocols - negotiate, kerberos, ntlm.\n3. TLS encryption on and off.\n\nFollow instructions in [README_sqlconnect.md] to run this test.\n##### sqlconnect_stress.js\nThis test validates integration with Tedious under stress by attempting to open\nabout 1000 connections in parallel and run a simple query on each connection,\nagain in parallel. The mix of connections is as below:\n1. Two instances of SQL Server, one local and one remote.\n2. Supported SSPI protocols - negotiate, kerberos, ntlm.\n3. TLS encryption on and off.\n\nFollow instructions in [README_sqlconnect.md] to run this test.\n\n[SSPI]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa380493(v=vs.85).aspx \"SSPI Windows\"\n[Tedious]: https://github.com/tediousjs/tedious \"Node.js implementation of TDS protocol.\"\n[Sample Code]: https://github.com/tvrprasad/sspi-client/blob/master/test/integration/sspi-client-test.js \"Sample Code\"\n[NodeJS]: https://nodejs.org/en/download/current/ \"NodeJS Download\"\n[test_config.json]: https://github.com/tvrprasad/sspi-client/blob/master/test/test_config.json \"Test Configuration\"\n[README_sspi_client_test.md]: https://github.com/tvrprasad/sspi-client/blob/master/test/integration/README_sspi_client_test.md \"README_sspi_client_test.md\"\n[README_sqlconnect.md]: https://github.com/tvrprasad/sspi-client/blob/master/test/integration/README_sqlconnect.md \"README_sqlconnect.md\"\n","_attachments":{},"homepage":"https://github.com/tvrprasad/sspi-client","bugs":{"url":"https://github.com/tvrprasad/sspi-client/issues"},"license":"MIT"}