In preparation of a new tedious release, I was going through all changes since v2.0.1. One thing I want to cleanup before the release is the integration with sspi-client.
I'm not super happy about the current situation where sspi-client is a hard dependency of tedious, and seeing that SQL Server actually supports more authentication methods and that there is another authentication related pull request in flight (#612) that adds node-kerberos as another hard dependency, I feel that the current approach for authentication methods is not scalable.
In this pull request, I explore the addition of what I call "authentication" providers (they're called "Security Support Providers" in the MS-TDS specification). The whole pull request is still very much in flux and a work in progress, but I believe the direction proposed here to be sound.
Authentication providers are simply objects that implement a .handshake(input, callback) method that is responsible for taking in authentication handshake data coming from SQL Server, and calling the passed callback with the handshake data that should be sent back to the SQL Server.
The long-term goal is to ship tedious with only a "default" dummy provider that does not actually do anything. Other providers like for NTLM, Kerberos or the native SSPI support will be extracted into separate npm modules organization. This way, we can extract both the implementation of these providers out of tedious, and keep tedious free from dependencies that are not required for all users.
The authentication provider to use for connecting to SQL Server will be specifiable via a new option when establishing a connection, and each provider will be able to handle options that are specific to it in it's own way.
For example, when using NTLM (domain) authentication I imagine connection creation could look like this:
new Connection({
"server": "localhost",
"userName": "sa",
"password": "yourStrong(!)Password",
"authProvider": require("tedious-auth-ntlm")({
"domain": "MYDOMAIN.COM",
"workstation": "FOOBARBAZ"
}),
"options": {
"port": 1433,
"database": "master"
}
});While native SSPI could look like this:
new Connection({
"server": "localhost",
"userName": "sa",
"password": "yourStrong(!)Password",
"authProvider": require("tedious-auth-native")({
"packageName": "negotiate"
}),
"options": {
"port": 1433,
"database": "master"
}
});@tvrprasad @v-suhame What do you think?
List view
0 issues of 1 selected
- Status: Open (in progress).tediousjs/tediousnumber 624#624 In tediousjs/tedious;