crash with Electron
Chris55 opened this issue · comments
Describe the bug
SSO authentication in an Electron app using node-expose-sspi is not working.
isActiveDirectoryReachable() returns always false and a breakpoint in domain.js line 41 the catch(e) {return false) shows:
Error: CoInitializeEx has failed: 0x80010106
at Object.openADConnection
To Reproduce
- Use Electron Forge template (https://www.electronforge.io/templates/typescript-+-webpack-template)
- add webpack-node-externals and node-expose-sspi dependencies
- add DEBUG=node-expose-sspi:* in start command
Sample is available here: https://github.com/Chris55/galere
Trace
2022-02-01T10:42:17.003Z node-expose-sspi:userdb getUser start
2022-02-01T10:42:17.006Z node-expose-sspi:adConnection closeADConnection: counter: 0
Warning: Active Directory not reachable
Expected behavior
isActiveDirectoryReachable() should return true and getUser() my user details.
Environment version:
- Windows 10 version 1909
- node: '16.9.1',
- electron: '16.0.8',
- chrome: '96.0.4664.110'
Please indicates also:
- Are you on a Windows domain ? yes
- Can you reach the domain controller ? yes
- Do your session have admin privileges ? no
- Which authentication protocol ? Kerberos
- Active Directory, or local window policies that could impact the authentication.: no
Additional context
it works fine on a simple node project without Electron.