win-sso 1.3.3 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,56 +0,0 @@
1
- #ifndef SECUR32_FACADE_HH
2
- #define SECUR32_FACADE_HH
3
-
4
- #define SECURITY_WIN32
5
-
6
- #include <napi.h>
7
-
8
- #include <windows.h>
9
- #include <sspi.h>
10
- #include <map>
11
-
12
- class AuthContext;
13
-
14
- class Secur32Facade {
15
- private:
16
- static std::map<unsigned long, std::shared_ptr<AuthContext>> acMap;
17
- static unsigned long acKey;
18
-
19
- public:
20
- /**
21
- * Returns the full username (domain\username) of the user running the process
22
- */
23
- static Napi::String GetLogonUserName(const Napi::CallbackInfo& info);
24
-
25
- static Napi::Number Secur32Facade::CreateAuthContext(const Napi::CallbackInfo& info);
26
- static Napi::Number Secur32Facade::FreeAuthContext(const Napi::CallbackInfo& info);
27
- /**
28
- * Creates a NTLM type 1 authentication token
29
- */
30
- static Napi::Buffer<unsigned char> CreateAuthRequest(const Napi::CallbackInfo& info);
31
-
32
- /**
33
- * Creates a NTLM type 3 authentication token
34
- */
35
- static Napi::Buffer<unsigned char> CreateAuthResponse(const Napi::CallbackInfo& info);
36
-
37
- static unsigned int GetMaxTokenLength(char* packageName, Napi::Env* env);
38
- static void AcquireCredentialsHandle(char* packageName, CredHandle* credHandle, SECURITY_INTEGER* lifeTime, Napi::Env* env);
39
- static void FreeCredentialsHandle(CredHandle* credHandle, Napi::Env* env);
40
- static int InitializeSecurityContext(
41
- SecBufferDesc* inSecBufferDesc,
42
- SecBufferDesc* outSecBufferDesc,
43
- char* targetHost,
44
- CredHandle* credHandle,
45
- struct _SecHandle* ctxHandle,
46
- unsigned long flags,
47
- SECURITY_INTEGER* lifeTime,
48
- Napi::Env* env);
49
- static void FreeContextHandle(struct _SecHandle* ctxHandle, Napi::Env* env);
50
- static Napi::Object Init(Napi::Env env, Napi::Object exports);
51
-
52
- private:
53
- static unsigned long GetDefaultFlags(std::string securityPackageName);
54
- };
55
-
56
- #endif