Skip to content
Browse files

Initial commit

  • Loading branch information...
0 parents commit 7bcfc54c1d6396187f2752d6bbff16db51630f71 @gfosco committed Dec 20, 2011
Showing with 850 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. BIN Debug/adauthftw.exp
  3. 0 Debug/adauthftw.ilk
  4. BIN Debug/adauthftw.lib
  5. BIN Debug/adauthftw.node
  6. +11 −0 Debug/adauthftw.node.metagen
  7. BIN Debug/adauthftw.pdb
  8. BIN Debug/adauthftwLib.dll
  9. +28 −0 README
  10. +42 −0 adauthftw.sln
  11. +15 −0 adauthftw.tss
  12. BIN adauthftw/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.obj
  13. +11 −0 adauthftw/Debug/ADAUTHFTWLIB.DLL.metagen
  14. BIN adauthftw/Debug/CL.read.1.tlog
  15. BIN adauthftw/Debug/CL.write.1.tlog
  16. 0 adauthftw/Debug/RSAENH.DLL.bi
  17. +34 −0 adauthftw/Debug/Sharp.log
  18. +17 −0 adauthftw/Debug/TSQLFTWLIB.DLL.metagen
  19. 0 adauthftw/Debug/TZRES.DLL.bi
  20. +2 −0 adauthftw/Debug/adauthftw.lastbuildstate
  21. +42 −0 adauthftw/Debug/adauthftw.log
  22. +10 −0 adauthftw/Debug/adauthftw.node.intermediate.manifest
  23. BIN adauthftw/Debug/adauthftw.obj
  24. +15 −0 adauthftw/Debug/adauthftw.write.1.tlog
  25. BIN adauthftw/Debug/adauthftwHelper.obj
  26. BIN adauthftw/Debug/cl.command.1.tlog
  27. +1 −0 adauthftw/Debug/link.1368.read.1.tlog
  28. +1 −0 adauthftw/Debug/link.1368.write.1.tlog
  29. +1 −0 adauthftw/Debug/link.2672.read.1.tlog
  30. +1 −0 adauthftw/Debug/link.2672.write.1.tlog
  31. +1 −0 adauthftw/Debug/link.2964.read.1.tlog
  32. +1 −0 adauthftw/Debug/link.2964.write.1.tlog
  33. +1 −0 adauthftw/Debug/link.3460.read.1.tlog
  34. +1 −0 adauthftw/Debug/link.3460.write.1.tlog
  35. +1 −0 adauthftw/Debug/link.4124.read.1.tlog
  36. +1 −0 adauthftw/Debug/link.4124.write.1.tlog
  37. +1 −0 adauthftw/Debug/link.4236.read.1.tlog
  38. +1 −0 adauthftw/Debug/link.4236.write.1.tlog
  39. +1 −0 adauthftw/Debug/link.4348.read.1.tlog
  40. +1 −0 adauthftw/Debug/link.4348.write.1.tlog
  41. +1 −0 adauthftw/Debug/link.4404.read.1.tlog
  42. +1 −0 adauthftw/Debug/link.4404.write.1.tlog
  43. +1 −0 adauthftw/Debug/link.5596.read.1.tlog
  44. +1 −0 adauthftw/Debug/link.5596.write.1.tlog
  45. +1 −0 adauthftw/Debug/link.6656.read.1.tlog
  46. +1 −0 adauthftw/Debug/link.6656.write.1.tlog
  47. +1 −0 adauthftw/Debug/link.7012.read.1.tlog
  48. +1 −0 adauthftw/Debug/link.7012.write.1.tlog
  49. +1 −0 adauthftw/Debug/link.7472.read.1.tlog
  50. +1 −0 adauthftw/Debug/link.7472.write.1.tlog
  51. +1 −0 adauthftw/Debug/link.7616.read.1.tlog
  52. +1 −0 adauthftw/Debug/link.7616.write.1.tlog
  53. BIN adauthftw/Debug/link.command.1.tlog
  54. BIN adauthftw/Debug/link.read.1.tlog
  55. BIN adauthftw/Debug/link.write.1.tlog
  56. BIN adauthftw/Debug/metagen.read.1.tlog
  57. BIN adauthftw/Debug/metagen.write.1.tlog
  58. BIN adauthftw/Debug/mt.command.1.tlog
  59. BIN adauthftw/Debug/mt.read.1.tlog
  60. BIN adauthftw/Debug/mt.write.1.tlog
  61. +2 −0 adauthftw/Debug/tsqlftw.lastbuildstate
  62. +48 −0 adauthftw/Debug/tsqlftw.log
  63. +10 −0 adauthftw/Debug/tsqlftw.node.intermediate.manifest
  64. BIN adauthftw/Debug/tsqlftw.obj
  65. +24 −0 adauthftw/Debug/tsqlftw.write.1.tlog
  66. BIN adauthftw/Debug/tsqlftwHelper.obj
  67. BIN adauthftw/Debug/vc100.pdb
  68. +173 −0 adauthftw/adauthftw.cpp
  69. +87 −0 adauthftw/adauthftw.vcxproj
  70. +3 −0 adauthftw/adauthftw.vcxproj.user
  71. +71 −0 adauthftw/adauthftwHelper.cpp
  72. +18 −0 adauthftw/adauthftwHelper.h
  73. +36 −0 adauthftwLib/Properties/AssemblyInfo.cs
  74. +32 −0 adauthftwLib/adauthftwClass.cs
  75. +55 −0 adauthftwLib/adauthftwlib.csproj
  76. BIN adauthftwLib/bin/Debug/adauthftwLib.dll
  77. BIN adauthftwLib/bin/Debug/adauthftwLib.pdb
  78. BIN adauthftwLib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  79. BIN adauthftwLib/obj/Debug/ResolveAssemblyReference.cache
  80. BIN adauthftwLib/obj/Debug/adauthftwLib.dll
  81. BIN adauthftwLib/obj/Debug/adauthftwLib.pdb
  82. +5 −0 adauthftwLib/obj/Debug/adauthftwlib.csproj.FileListAbsolute.txt
  83. BIN adauthftwLib/obj/Debug/tsqlftwLib.dll
  84. BIN adauthftwLib/obj/Debug/tsqlftwLib.pdb
  85. +13 −0 adauthftwLib/obj/Debug/tsqlftwlib.csproj.FileListAbsolute.txt
  86. BIN example/adauthftw.node
  87. BIN example/adauthftwLib.dll
  88. +12 −0 example/test.js
8 .gitignore
@@ -0,0 +1,8 @@
+*.sdf
+*.opensdf
+*.suo
+_ReSharper.*
+*.ReSharper.user
+*.resharper.user
+*.unsuccessfulbuild
+*.ipch
BIN Debug/adauthftw.exp
Binary file not shown.
0 Debug/adauthftw.ilk
No changes.
BIN Debug/adauthftw.lib
Binary file not shown.
BIN Debug/adauthftw.node
Binary file not shown.
11 Debug/adauthftw.node.metagen
@@ -0,0 +1,11 @@
+ImageRuntimeVersion: v4.0.30319
+Assembly adauthftw, Version=0.0.*, Culture=Invariant Language (Invariant Country):
+ hash=SHA1, flags=PublicKey
+Assembly mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:
+ hash=None, flags=None
+Assembly adauthftwLib, Version=1.0.*, Culture=Invariant Language (Invariant Country):
+ hash=None, flags=None
+Assembly Microsoft.VisualC, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a:
+ hash=None, flags=None
+Assembly System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:
+ hash=None, flags=None
BIN Debug/adauthftw.pdb
Binary file not shown.
BIN Debug/adauthftwLib.dll
Binary file not shown.
28 README
@@ -0,0 +1,28 @@
+ADAuthFTW - Simple Active Directory Authentication - by Fosco Marotto (gfosco@gmail.com)
+
+Work in Progress... Currently supports simple authentication against an Active Directory server.
+
+This is the package for the C++/.NET Node Module. The Debug folder holds the current working output, and example code in the /example folder.
+
+usage example:
+
+var ad = new (require('./adauthftw').adauthftw)();
+
+ad.auth('LDAP://whatever.domain.com/DC=DOMAIN,DC=com',
+ 'testuser',
+ 'testpass',
+ function (err, result) {
+ if (result) {
+ console.log('Authentication successful');
+ } else {
+ console.log('Authentication failed.');
+ }
+});
+
+
+
+
+
+Credits:
+* saary - node.net module example. https://github.com/saary/node.net
+
42 adauthftw.sln
@@ -0,0 +1,42 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adauthftw", "adauthftw\adauthftw.vcxproj", "{74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "adauthftwlib", "adauthftwLib\adauthftwlib.csproj", "{17CEA729-1E55-4E47-BD12-1FDE7B23124E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|Win32 = Debug|Win32
+ Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Debug|Win32.Build.0 = Debug|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Release|Any CPU.ActiveCfg = Release|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Release|Win32.ActiveCfg = Release|Win32
+ {74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}.Release|Win32.Build.0 = Release|Win32
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {17CEA729-1E55-4E47-BD12-1FDE7B23124E}.Release|Win32.ActiveCfg = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
15 adauthftw.tss
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<ArrayOfArrayOfArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <ArrayOfArrayOfString>
+ <ArrayOfString>
+ <string>C:\git\adauthftw\adauthftw\adauthftwHelper.cpp</string>
+ <string>C:\git\adauthftw\adauthftw\adauthftwHelper.h</string>
+ </ArrayOfString>
+ <ArrayOfString>
+ <string>C:\git\adauthftw\adauthftwLib\adauthftwClass.cs</string>
+ </ArrayOfString>
+ <ArrayOfString>
+ <string>C:\git\adauthftw\adauthftw\adauthftw.cpp</string>
+ </ArrayOfString>
+ </ArrayOfArrayOfString>
+</ArrayOfArrayOfArrayOfString>
BIN adauthftw/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.obj
Binary file not shown.
11 adauthftw/Debug/ADAUTHFTWLIB.DLL.metagen
@@ -0,0 +1,11 @@
+ImageRuntimeVersion: v4.0.30319
+Assembly adauthftwLib, Version=1.0.*, Culture=Invariant Language (Invariant Country):
+ hash=SHA1, flags=PublicKey
+Assembly mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:
+ hash=None, flags=None
+Assembly System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a:
+ hash=None, flags=None
+Class adauthftw.adauthftwClass: AutoLayout, AnsiClass, Class, Public, BeforeFieldInit
+ Void .ctor(): PrivateScope, Public, HideBySig, SpecialName, RTSpecialName
+ Methods:
+ Authenticate(String, String, String): PrivateScope, Public, HideBySig
BIN adauthftw/Debug/CL.read.1.tlog
Binary file not shown.
BIN adauthftw/Debug/CL.write.1.tlog
Binary file not shown.
0 adauthftw/Debug/RSAENH.DLL.bi
No changes.
34 adauthftw/Debug/Sharp.log
@@ -0,0 +1,34 @@
+Build started 12/14/2011 12:35:33 AM.
+ 1>Project "D:\Git\node.net\Sharp\Sharp.vcxproj" on node 2 (build target(s)).
+ 1>InitializeBuildStatus:
+ Touching "Debug\tsqlftw.unsuccessfulbuild".
+ GenerateTargetFrameworkMonikerAttribute:
+ Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
+ ClCompile:
+ All outputs are up-to-date.
+ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /AI"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /Zi /clr /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDLL /D _UNICODE /D UNICODE /EHa /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /TP /analyze- /errorReport:prompt tsqlftwHelper.cpp /clr:nostdlib
+ tsqlftwHelper.cpp
+ 1>D:\node-v0.6.5\src\node_object_wrap.h(57): warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
+ with
+ [
+ T=v8::Object
+ ]
+ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /clr /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDLL /D _UNICODE /D UNICODE /EHa /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /TP /analyze- /errorReport:prompt "C:\Users\Power\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cpp"
+ .NETFramework,Version=v4.0.AssemblyAttributes.cpp
+ Link:
+ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"D:\Git\node.net\Debug\tsqlftw.node" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Debug\tsqlftw.node.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\Git\node.net\Debug\tsqlftw.pdb" /ASSEMBLYDEBUG /TLBID:1 /DYNAMICBASE /FIXED:NO /NXCOMPAT /MACHINE:X86 /DLL Debug\tsqlftw.obj
+ Debug\tsqlftwHelper.obj
+ "Debug\.NETFramework,Version=v4.0.AssemblyAttributes.obj"
+ Creating library D:\Git\node.net\Debug\tsqlftw.lib and object D:\Git\node.net\Debug\tsqlftw.exp
+ 1>tsqlftwHelper.obj : warning LNK4248: unresolved typeref token (01000013) for 'v8.internal.Object'; image may not run
+ Sharp.vcxproj -> D:\Git\node.net\Debug\tsqlftw.node
+ Manifest:
+ C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /outputresource:"D:\Git\node.net\Debug\tsqlftw.node;#2" /manifest Debug\tsqlftw.node.intermediate.manifest
+ FinalizeBuildStatus:
+ Deleting file "Debug\tsqlftw.unsuccessfulbuild".
+ Touching "Debug\tsqlftw.lastbuildstate".
+ 1>Done Building Project "D:\Git\node.net\Sharp\Sharp.vcxproj" (build target(s)).
+
+Build succeeded.
+
+Time Elapsed 00:00:01.45
17 adauthftw/Debug/TSQLFTWLIB.DLL.metagen
@@ -0,0 +1,17 @@
+ImageRuntimeVersion: v4.0.30319
+Assembly tsqlftwLib, Version=1.0.*, Culture=Invariant Language (Invariant Country):
+ hash=SHA1, flags=PublicKey
+Assembly mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:
+ hash=None, flags=None
+Assembly System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:
+ hash=None, flags=None
+Assembly Newtonsoft.Json, Version=4.0.4.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed:
+ hash=None, flags=None
+Class tsqlftw.tsqlftwClass: AutoLayout, AnsiClass, Class, Public, BeforeFieldInit
+ Void .ctor(): PrivateScope, Public, HideBySig, SpecialName, RTSpecialName
+ Fields:
+ System.Data.SqlClient.SqlConnection Conn : Public
+ Methods:
+ Connect(String): PrivateScope, Public, HideBySig
+ Query(String): PrivateScope, Public, HideBySig
+ Close(): PrivateScope, Public, HideBySig
0 adauthftw/Debug/TZRES.DLL.bi
No changes.
2 adauthftw/Debug/adauthftw.lastbuildstate
@@ -0,0 +1,2 @@
+#v4.0:v100:true
+Debug|Win32|C:\git\adauthftw\|
42 adauthftw/Debug/adauthftw.log
@@ -0,0 +1,42 @@
+Build started 12/20/2011 1:39:14 PM.
+ 1>Project "C:\git\adauthftw\adauthftw\adauthftw.vcxproj" on node 2 (build target(s)).
+ 1>InitializeBuildStatus:
+ Creating "Debug\adauthftw.unsuccessfulbuild" because "AlwaysCreate" was specified.
+ GenerateTargetFrameworkMonikerAttribute:
+ Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
+ 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MetaGen.targets(91,5): warning : Required file "D:\GIT\NODE.NET\SHARPLIB\BIN\DEBUG\TSQLFTWLIB.DLL" is missing.
+ The previous error was converted to a warning because the task was called with ContinueOnError=true.
+ ClCompile:
+ All outputs are up-to-date.
+ C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /AI"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /Zi /clr /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDLL /D _UNICODE /D UNICODE /EHa /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /TP /analyze- /errorReport:prompt adauthftwHelper.cpp /clr:nostdlib
+ adauthftwHelper.cpp
+ 1>C:\node-v0.6.5\src\node_object_wrap.h(57): warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
+ with
+ [
+ T=v8::Object
+ ]
+ All outputs are up-to-date.
+ ManagedIncrementalBuildPostProcessDependencyGraph:
+ To improve incremental build performance for managed components, please make sure that the 'VC++ Directories->Reference Directories' points to all the paths which contain the referenced managed assemblies.
+ Could not load file or assembly 'file:///C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\VC\BIN\1033\CLUI.DLL' or one of its dependencies. The system cannot find the file specified.
+ To improve incremental build performance for managed components, please make sure that the 'VC++ Directories->Reference Directories' points to all the paths which contain the referenced managed assemblies.
+ Could not load file or assembly 'file:///C:\PROGRAM FILES (X86)\REFERENCE ASSEMBLIES\MICROSOFT\FRAMEWORK\.NETFRAMEWORK\V4.0\MSCORLIB.DLL' or one of its dependencies. The system cannot find the file specified.
+ To improve incremental build performance for managed components, please make sure that the 'VC++ Directories->Reference Directories' points to all the paths which contain the referenced managed assemblies.
+ Could not load file or assembly 'file:///C:\PROGRAM FILES (X86)\REFERENCE ASSEMBLIES\MICROSOFT\FRAMEWORK\.NETFRAMEWORK\V4.0\MICROSOFT.VISUALC.DLL' or one of its dependencies. The system cannot find the file specified.
+ Link:
+ C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\git\adauthftw\Debug\adauthftw.node" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Debug\adauthftw.node.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\git\adauthftw\Debug\adauthftw.pdb" /ASSEMBLYDEBUG /TLBID:1 /DYNAMICBASE /FIXED:NO /NXCOMPAT /MACHINE:X86 /DLL Debug\adauthftw.obj
+ Debug\adauthftwHelper.obj
+ "Debug\.NETFramework,Version=v4.0.AssemblyAttributes.obj"
+ Creating library C:\git\adauthftw\Debug\adauthftw.lib and object C:\git\adauthftw\Debug\adauthftw.exp
+ 1>adauthftwHelper.obj : warning LNK4248: unresolved typeref token (01000013) for 'v8.internal.Object'; image may not run
+ adauthftw.vcxproj -> C:\git\adauthftw\Debug\adauthftw.node
+ Manifest:
+ c:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /outputresource:"C:\git\adauthftw\Debug\adauthftw.node;#2" /manifest Debug\adauthftw.node.intermediate.manifest
+ FinalizeBuildStatus:
+ Deleting file "Debug\adauthftw.unsuccessfulbuild".
+ Touching "Debug\adauthftw.lastbuildstate".
+ 1>Done Building Project "C:\git\adauthftw\adauthftw\adauthftw.vcxproj" (build target(s)).
+
+Build succeeded.
+
+Time Elapsed 00:00:03.14
10 adauthftw/Debug/adauthftw.node.intermediate.manifest
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level='asInvoker' uiAccess='false' />
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
BIN adauthftw/Debug/adauthftw.obj
Binary file not shown.
15 adauthftw/Debug/adauthftw.write.1.tlog
@@ -0,0 +1,15 @@
+^C:\git\adauthftw\adauthftw\adauthftw.vcxproj
+C:\git\adauthftw\Debug\adauthftw.lib
+C:\git\adauthftw\Debug\adauthftw.exp
+^C:\git\adauthftw\adauthftw\adauthftw.vcxproj
+C:\git\adauthftw\Debug\adauthftw.lib
+C:\git\adauthftw\Debug\adauthftw.exp
+^C:\git\adauthftw\adauthftw\adauthftw.vcxproj
+C:\git\adauthftw\Debug\adauthftw.lib
+C:\git\adauthftw\Debug\adauthftw.exp
+^C:\git\adauthftw\adauthftw\adauthftw.vcxproj
+C:\git\adauthftw\Debug\adauthftw.lib
+C:\git\adauthftw\Debug\adauthftw.exp
+^C:\git\adauthftw\adauthftw\adauthftw.vcxproj
+C:\git\adauthftw\Debug\adauthftw.lib
+C:\git\adauthftw\Debug\adauthftw.exp
BIN adauthftw/Debug/adauthftwHelper.obj
Binary file not shown.
BIN adauthftw/Debug/cl.command.1.tlog
Binary file not shown.
1 adauthftw/Debug/link.1368.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.1368.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.2672.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.2672.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.2964.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.2964.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.3460.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.3460.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.4124.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.4124.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.4236.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.4236.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.4348.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.4348.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.4404.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.4404.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.5596.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.5596.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.6656.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.6656.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.7012.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.7012.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.7472.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.7472.write.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.7616.read.1.tlog
@@ -0,0 +1 @@
+��
1 adauthftw/Debug/link.7616.write.1.tlog
@@ -0,0 +1 @@
+��
BIN adauthftw/Debug/link.command.1.tlog
Binary file not shown.
BIN adauthftw/Debug/link.read.1.tlog
Binary file not shown.
BIN adauthftw/Debug/link.write.1.tlog
Binary file not shown.
BIN adauthftw/Debug/metagen.read.1.tlog
Binary file not shown.
BIN adauthftw/Debug/metagen.write.1.tlog
Binary file not shown.
BIN adauthftw/Debug/mt.command.1.tlog
Binary file not shown.
BIN adauthftw/Debug/mt.read.1.tlog
Binary file not shown.
BIN adauthftw/Debug/mt.write.1.tlog
Binary file not shown.
2 adauthftw/Debug/tsqlftw.lastbuildstate
@@ -0,0 +1,2 @@
+#v4.0:v100:true
+Debug|Win32|C:\git\node.net\|
48 adauthftw/Debug/tsqlftw.log
@@ -0,0 +1,48 @@
+Build started 12/19/2011 1:52:41 PM.
+ 1>Project "C:\git\node.net\tsqlftw\tsqlftw.vcxproj" on node 2 (build target(s)).
+ 1>InitializeBuildStatus:
+ Touching "Debug\tsqlftw.unsuccessfulbuild".
+ GenerateTargetFrameworkMonikerAttribute:
+ Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
+ 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MetaGen.targets(91,5): warning : Required file "D:\GIT\NODE.NET\SHARPLIB\BIN\DEBUG\TSQLFTWLIB.DLL" is missing.
+ The previous error was converted to a warning because the task was called with ContinueOnError=true.
+ ClCompile:
+ C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /AI"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /Zi /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDLL /D _UNICODE /D UNICODE /EHa /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /TP /analyze- /errorReport:prompt tsqlftw.cpp /clr:nostdlib
+ tsqlftw.cpp
+ 1>C:\node-v0.6.5\src\node_object_wrap.h(57): warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
+ with
+ [
+ T=v8::Object
+ ]
+ C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /AI"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /Zi /clr /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDLL /D _UNICODE /D UNICODE /EHa /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /TP /analyze- /errorReport:prompt tsqlftwHelper.cpp /clr:nostdlib
+ tsqlftwHelper.cpp
+ 1>C:\node-v0.6.5\src\node_object_wrap.h(57): warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
+ with
+ [
+ T=v8::Object
+ ]
+ All outputs are up-to-date.
+ ManagedIncrementalBuildPostProcessDependencyGraph:
+ To improve incremental build performance for managed components, please make sure that the 'VC++ Directories->Reference Directories' points to all the paths which contain the referenced managed assemblies.
+ Could not load file or assembly 'file:///C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\VC\BIN\1033\CLUI.DLL' or one of its dependencies. The system cannot find the file specified.
+ To improve incremental build performance for managed components, please make sure that the 'VC++ Directories->Reference Directories' points to all the paths which contain the referenced managed assemblies.
+ Could not load file or assembly 'file:///C:\PROGRAM FILES (X86)\REFERENCE ASSEMBLIES\MICROSOFT\FRAMEWORK\.NETFRAMEWORK\V4.0\MSCORLIB.DLL' or one of its dependencies. The system cannot find the file specified.
+ To improve incremental build performance for managed components, please make sure that the 'VC++ Directories->Reference Directories' points to all the paths which contain the referenced managed assemblies.
+ Could not load file or assembly 'file:///C:\PROGRAM FILES (X86)\REFERENCE ASSEMBLIES\MICROSOFT\FRAMEWORK\.NETFRAMEWORK\V4.0\MICROSOFT.VISUALC.DLL' or one of its dependencies. The system cannot find the file specified.
+ Link:
+ C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\git\node.net\Debug\tsqlftw.node" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Debug\tsqlftw.node.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\git\node.net\Debug\tsqlftw.pdb" /ASSEMBLYDEBUG /TLBID:1 /DYNAMICBASE /FIXED:NO /NXCOMPAT /MACHINE:X86 /DLL Debug\tsqlftw.obj
+ Debug\tsqlftwHelper.obj
+ "Debug\.NETFramework,Version=v4.0.AssemblyAttributes.obj"
+ Creating library C:\git\node.net\Debug\tsqlftw.lib and object C:\git\node.net\Debug\tsqlftw.exp
+ 1>tsqlftwHelper.obj : warning LNK4248: unresolved typeref token (01000013) for 'v8.internal.Object'; image may not run
+ tsqlftw.vcxproj -> C:\git\node.net\Debug\tsqlftw.node
+ Manifest:
+ c:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /outputresource:"C:\git\node.net\Debug\tsqlftw.node;#2" /manifest Debug\tsqlftw.node.intermediate.manifest
+ FinalizeBuildStatus:
+ Deleting file "Debug\tsqlftw.unsuccessfulbuild".
+ Touching "Debug\tsqlftw.lastbuildstate".
+ 1>Done Building Project "C:\git\node.net\tsqlftw\tsqlftw.vcxproj" (build target(s)).
+
+Build succeeded.
+
+Time Elapsed 00:00:03.78
10 adauthftw/Debug/tsqlftw.node.intermediate.manifest
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level='asInvoker' uiAccess='false' />
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
BIN adauthftw/Debug/tsqlftw.obj
Binary file not shown.
24 adauthftw/Debug/tsqlftw.write.1.tlog
@@ -0,0 +1,24 @@
+^D:\Git\node.net\Sharp\Sharp.vcxproj
+D:\Git\node.net\Debug\tsqlftw.lib
+D:\Git\node.net\Debug\tsqlftw.exp
+^C:\git\node.net\tsqlftw\tsqlftw.vcxproj
+C:\git\node.net\Debug\tsqlftw.lib
+C:\git\node.net\Debug\tsqlftw.exp
+^C:\git\node.net\tsqlftw\tsqlftw.vcxproj
+C:\git\node.net\Debug\tsqlftw.lib
+C:\git\node.net\Debug\tsqlftw.exp
+^C:\git\node.net\tsqlftw\tsqlftw.vcxproj
+C:\git\node.net\Debug\tsqlftw.lib
+C:\git\node.net\Debug\tsqlftw.exp
+^C:\git\node.net\tsqlftw\tsqlftw.vcxproj
+C:\git\node.net\Debug\tsqlftw.lib
+C:\git\node.net\Debug\tsqlftw.exp
+^C:\git\node.net\tsqlftw\tsqlftw.vcxproj
+C:\git\node.net\Debug\tsqlftw.lib
+C:\git\node.net\Debug\tsqlftw.exp
+^C:\git\node.net\tsqlftw\tsqlftw.vcxproj
+C:\git\node.net\Debug\tsqlftw.lib
+C:\git\node.net\Debug\tsqlftw.exp
+^C:\git\node.net\tsqlftw\tsqlftw.vcxproj
+C:\git\node.net\Debug\tsqlftw.lib
+C:\git\node.net\Debug\tsqlftw.exp
BIN adauthftw/Debug/tsqlftwHelper.obj
Binary file not shown.
BIN adauthftw/Debug/vc100.pdb
Binary file not shown.
173 adauthftw/adauthftw.cpp
@@ -0,0 +1,173 @@
+#pragma comment(lib, "node")
+
+#include <node.h>
+#include <v8.h>
+#include <string>
+
+#include "adauthftwHelper.h"
+
+using namespace node;
+using namespace v8;
+
+class adauthftw: ObjectWrap
+{
+private:
+ adauthftwHelper* _adauthftwHelper;
+public:
+
+ static Persistent<FunctionTemplate> s_ct;
+ static void NODE_EXTERN Init(Handle<Object> target)
+ {
+ HandleScope scope;
+
+ // set the constructor function
+ Local<FunctionTemplate> t = FunctionTemplate::New(New);
+
+ // set the node.js/v8 class name
+ s_ct = Persistent<FunctionTemplate>::New(t);
+ s_ct->InstanceTemplate()->SetInternalFieldCount(1);
+ s_ct->SetClassName(String::NewSymbol("adauthftw"));
+
+ // registers a class member functions
+ NODE_SET_PROTOTYPE_METHOD(s_ct, "auth", auth);
+
+ target->Set(String::NewSymbol("adauthftw"),
+ s_ct->GetFunction());
+ }
+
+ adauthftw()
+ {
+ _adauthftwHelper = adauthftwHelper::New();
+ }
+
+ ~adauthftw()
+ {
+ delete _adauthftwHelper;
+ }
+
+ static Handle<Value> New(const Arguments& args)
+ {
+ HandleScope scope;
+ adauthftw* pm = new adauthftw();
+ pm->Wrap(args.This());
+ return args.This();
+ }
+
+ struct BatonAuth {
+ uv_work_t request;
+ adauthftwHelper* adauthftwHelper;
+ Persistent<Function> callback;
+ std::string path;
+ std::string user;
+ std::string pass;
+ bool error;
+ std::string error_message;
+ std::string result;
+ };
+
+ static Handle<Value> auth(const Arguments& args)
+ {
+ HandleScope scope;
+
+ if (!args[0]->IsString()) {
+ return ThrowException(Exception::TypeError(
+ String::New("First argument must be a string")));
+ }
+
+ if (!args[1]->IsString()) {
+ return ThrowException(Exception::TypeError(
+ String::New("Second argument must be a string")));
+ }
+
+ if (!args[2]->IsString()) {
+ return ThrowException(Exception::TypeError(
+ String::New("Third argument must be a string")));
+ }
+
+ if (!args[3]->IsFunction()) {
+ return ThrowException(Exception::TypeError(
+ String::New("Fourth argument must be a callback function")));
+ }
+
+ Local<String> path = Local<String>::Cast(args[0]);
+ Local<String> user = Local<String>::Cast(args[1]);
+ Local<String> pass = Local<String>::Cast(args[2]);
+ // There's no ToFunction(), use a Cast instead.
+ Local<Function> callback = Local<Function>::Cast(args[3]);
+
+ adauthftw* so = ObjectWrap::Unwrap<adauthftw>(args.This());
+
+ // create a state object
+ BatonAuth* baton = new BatonAuth();
+ baton->request.data = baton;
+ baton->adauthftwHelper = so->_adauthftwHelper;
+ baton->callback = Persistent<Function>::New(callback);
+ baton->path = *v8::String::AsciiValue(path);
+ baton->user = *v8::String::AsciiValue(user);
+ baton->pass = *v8::String::AsciiValue(pass);
+
+ // register a worker thread request
+ uv_queue_work(uv_default_loop(), &baton->request,
+ StartAuth, AfterAuth);
+
+ return Undefined();
+
+ }
+
+ static void StartAuth(uv_work_t* req)
+ {
+ BatonAuth *baton = static_cast<BatonAuth*>(req->data);
+ baton->error = baton->adauthftwHelper->auth(baton->path, baton->user, baton->pass, baton->error_message, baton->result);
+ }
+
+ static void AfterAuth(uv_work_t *req)
+ {
+ HandleScope scope;
+ BatonAuth* baton = static_cast<BatonAuth*>(req->data);
+
+ if (baton->error)
+ {
+ Local<Value> err = Exception::Error(
+ String::New(baton->error_message.c_str()));
+ Local<Value> argv[] = { err };
+
+ TryCatch try_catch;
+ baton->callback->Call(
+ Context::GetCurrent()->Global(), 1, argv);
+
+ if (try_catch.HasCaught()) {
+ node::FatalException(try_catch);
+ }
+ }
+ else
+ {
+ const unsigned argc = 2;
+ Local<Value> argv[argc] = {
+ Local<Value>::New(Null()),
+ Local<Value>::New(String::New(baton->result.c_str()))
+ };
+
+ TryCatch try_catch;
+ baton->callback->Call(Context::GetCurrent()->Global(), argc, argv);
+
+ if (try_catch.HasCaught()) {
+ FatalException(try_catch);
+ }
+ }
+
+ baton->callback.Dispose();
+ delete baton;
+ }
+
+};
+
+Persistent<FunctionTemplate> adauthftw::s_ct;
+
+extern "C" {
+ void NODE_EXTERN init (Handle<Object> target)
+ {
+ adauthftw::Init(target);
+ LoadAssembly();
+ }
+ NODE_MODULE(adauthftw, init);
+}
87 adauthftw/adauthftw.vcxproj
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{74153EEB-90DB-4E5B-AA58-2AD21AEDD3CD}</ProjectGuid>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <Keyword>ManagedCProj</Keyword>
+ <RootNamespace>adauthftw</RootNamespace>
+ <ProjectName>adauthftw</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <IncludePath>C:\node-v0.6.5\deps\v8\include;C:\node-v0.6.5\deps\uv\include;C:\node-v0.6.5\src;$(IncludePath)</IncludePath>
+ <LibraryPath>C:\node-v0.6.5\Debug;C:\node-v0.6.5\Debug\lib;$(LibraryPath)</LibraryPath>
+ <TargetExt>.node</TargetExt>
+ <ReferencePath>C:\Git\adauthftw\adauthftwLib\bin;$(ReferencePath)</ReferencePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>
+ </AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="adauthftw.cpp">
+ <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+ </ClCompile>
+ <ClCompile Include="adauthftwHelper.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="adauthftwHelper.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
3 adauthftw/adauthftw.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
71 adauthftw/adauthftwHelper.cpp
@@ -0,0 +1,71 @@
+#include "adauthftwHelper.h"
+#using <mscorlib.dll>
+#using <C:\Git\adauthftw\adauthftwLib\bin\Debug\adauthftwLib.dll>
+#include <gcroot.h>
+
+using namespace System::Runtime::InteropServices;
+using namespace System::Reflection;
+using namespace adauthftw;
+
+// we need to look for the assembly in the current directory
+// node will search for it next to the node.exe binary
+System::Reflection::Assembly ^OnAssemblyResolve(System::Object ^obj, System::ResolveEventArgs ^args)
+{
+ System::String ^path = System::Environment::CurrentDirectory;
+ array<System::String^>^ assemblies =
+ System::IO::Directory::GetFiles(path, "*.dll");
+ for (long ii = 0; ii < assemblies->Length; ii++) {
+ AssemblyName ^name = AssemblyName::GetAssemblyName(assemblies[ii]);
+ if (AssemblyName::ReferenceMatchesDefinition(gcnew AssemblyName(args->Name), name)) {
+ return Assembly::Load(name);
+ }
+ }
+ return nullptr;
+}
+
+// register a custom assembly load handler
+void LoadAssembly()
+{
+ System::AppDomain::CurrentDomain->AssemblyResolve +=
+ gcnew System::ResolveEventHandler(OnAssemblyResolve);
+}
+
+class adauthftwWrapper : public adauthftwHelper {
+private:
+ gcroot<adauthftwClass^> _adauthftwClass;
+
+public:
+ adauthftwWrapper()
+ {
+ _adauthftwClass = gcnew adauthftwClass();
+ }
+
+ virtual bool auth(std::string& path, std::string& user, std::string& pass, std::string& err, std::string& result)
+ {
+ try
+ {
+ System::String^ data = "";
+ if (_adauthftwClass->Authenticate(gcnew System::String(path.c_str()), gcnew System::String(user.c_str()), gcnew System::String(pass.c_str()))) data = "true";
+
+ System::IntPtr p = Marshal::StringToHGlobalAnsi(data);
+ result = static_cast<char*>(p.ToPointer());
+ Marshal::FreeHGlobal(p);
+ return false;
+ }
+ catch(System::Exception^ e)
+ {
+ System::IntPtr p = Marshal::StringToHGlobalAnsi(e->Message);
+ err = static_cast<char*>(p.ToPointer());
+ Marshal::FreeHGlobal(p);
+ return true;
+ }
+ }
+
+
+};
+
+adauthftwHelper* adauthftwHelper::New()
+{
+ return new adauthftwWrapper();
+}
+
18 adauthftw/adauthftwHelper.h
@@ -0,0 +1,18 @@
+#include <node.h>
+#include <v8.h>
+#include <string>
+
+using namespace v8;
+
+void LoadAssembly();
+
+// this is a shim class which mediates between managed and unmanaged code
+class adauthftwHelper
+{
+protected:
+ adauthftwHelper() {};
+public:
+ virtual bool auth(std::string& path, std::string& user, std::string& pass, std::string& err, std::string& result) = 0;
+
+ static adauthftwHelper* New();
+};
36 adauthftwLib/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("tsqlftw")]
+[assembly: AssemblyDescription("MSSQL Module for Node, native and asynchronous")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("tsqlftw")]
+[assembly: AssemblyCopyright("Created by Fosco Marotto gfosco@gmail.com")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("fb2b4cb4-cb4e-876d-3207-e3728b79fb2b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
32 adauthftwLib/adauthftwClass.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Net;
+using System.DirectoryServices;
+
+namespace adauthftw
+{
+ public class adauthftwClass
+ {
+
+ public bool Authenticate(string path, string user, string pass)
+ {
+ try
+ {
+ var ad = new DirectoryEntry(path, user, pass);
+ if (ad.Properties.Count > 0) return true;
+ }
+ catch (Exception ex)
+ {
+ return false;
+ }
+ return false;
+ }
+
+ public adauthftwClass()
+ {
+
+ }
+ }
+}
55 adauthftwLib/adauthftwlib.csproj
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{17CEA729-1E55-4E47-BD12-1FDE7B23124E}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>adauthftw</RootNamespace>
+ <AssemblyName>adauthftwLib</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.DirectoryServices" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="adauthftwClass.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
BIN adauthftwLib/bin/Debug/adauthftwLib.dll
Binary file not shown.
BIN adauthftwLib/bin/Debug/adauthftwLib.pdb
Binary file not shown.
BIN adauthftwLib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
BIN adauthftwLib/obj/Debug/ResolveAssemblyReference.cache
Binary file not shown.
BIN adauthftwLib/obj/Debug/adauthftwLib.dll
Binary file not shown.
BIN adauthftwLib/obj/Debug/adauthftwLib.pdb
Binary file not shown.
5 adauthftwLib/obj/Debug/adauthftwlib.csproj.FileListAbsolute.txt
@@ -0,0 +1,5 @@
+C:\git\adauthftw\adauthftwLib\bin\Debug\adauthftwLib.dll
+C:\git\adauthftw\adauthftwLib\bin\Debug\adauthftwLib.pdb
+C:\git\adauthftw\adauthftwLib\obj\Debug\ResolveAssemblyReference.cache
+C:\git\adauthftw\adauthftwLib\obj\Debug\adauthftwLib.dll
+C:\git\adauthftw\adauthftwLib\obj\Debug\adauthftwLib.pdb
BIN adauthftwLib/obj/Debug/tsqlftwLib.dll
Binary file not shown.
BIN adauthftwLib/obj/Debug/tsqlftwLib.pdb
Binary file not shown.
13 adauthftwLib/obj/Debug/tsqlftwlib.csproj.FileListAbsolute.txt
@@ -0,0 +1,13 @@
+D:\Git\node.net\SharpLib\obj\Debug\ResolveAssemblyReference.cache
+D:\Git\node.net\SharpLib\bin\Debug\tsqlftwLib.dll
+D:\Git\node.net\SharpLib\bin\Debug\tsqlftwLib.pdb
+D:\Git\node.net\SharpLib\obj\Debug\tsqlftwLib.dll
+D:\Git\node.net\SharpLib\obj\Debug\tsqlftwLib.pdb
+C:\git\node.net\tsqlftwLib\bin\Debug\tsqlftwLib.dll
+C:\git\node.net\tsqlftwLib\bin\Debug\tsqlftwLib.pdb
+C:\git\node.net\tsqlftwLib\obj\Debug\ResolveAssemblyReference.cache
+C:\git\node.net\tsqlftwLib\obj\Debug\tsqlftwLib.dll
+C:\git\node.net\tsqlftwLib\obj\Debug\tsqlftwLib.pdb
+C:\git\node.net\tsqlftwLib\bin\Debug\Newtonsoft.Json.dll
+C:\git\node.net\tsqlftwLib\bin\Debug\Newtonsoft.Json.pdb
+C:\git\node.net\tsqlftwLib\bin\Debug\Newtonsoft.Json.xml
BIN example/adauthftw.node
Binary file not shown.
BIN example/adauthftwLib.dll
Binary file not shown.
12 example/test.js
@@ -0,0 +1,12 @@
+var ad = new (require('./adauthftw').adauthftw)();
+
+ad.auth('LDAP://whatever.domain.com/DC=DOMAIN,DC=com',
+ 'testuser',
+ 'testpass',
+ function (err, result) {
+ if (result) {
+ console.log('Authentication successful');
+ } else {
+ console.log('Authentication failed.');
+ }
+});

0 comments on commit 7bcfc54

Please sign in to comment.
Something went wrong with that request. Please try again.