First
This commit is contained in:
17
auth.py
Normal file
17
auth.py
Normal 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)
|
Reference in New Issue
Block a user