This commit is contained in:
2022-09-22 07:10:08 -04:00
parent 2028b35226
commit 7f5ed98386
33 changed files with 2611 additions and 1 deletions

17
auth.py Normal file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env python3
import ctypes
# Load DLL
XUIAMSSOi = ctypes.WinDLL('C:\\Program Files (x86)\\Micro Focus\\Reflection\\XUIAMSSOi.dll')
XUIAMSSOi.MySsoTokenVBA.restype = ctypes.c_long
XUIAMSSOi.MySsoTokenVBA.argtypes = (ctypes.c_wchar_p, ctypes.c_long)
# Authenticate against smartcard
def XUIAMSSOi_MySsoTokenVBA(bufsize=15000):
buf = ctypes.create_unicode_buffer(bufsize)
sz = XUIAMSSOi.MySsoTokenVBA(buf, bufsize)
if sz <= bufsize:
return buf.value.encode('utf-16')[2:].decode('latin-1')
else:
return XUIAMSSOi_MySsoTokenVBA(sz)