Error 1312 when using the python firewall in Windows Server 2003

I am writing a windows service in python and I am using the keyring module to securely store credentials that I need to use regularly and persistently. This means that keyring stores passwords using the user credentials of the local system.

All I do is use the two main keyring functions: get_password(SERVICE_NAME, username, password)and set_password(SERVICE_NAME, username). I did not pre-configure keyring, as I understood it, and saw that it automatically configures its backend.

When I run this on Windows Server 2008 and above, everything runs smoothly. But when I run this on Windows Server 2003, I get this nasty error:

error: (1312, 'CredWrite', 'A specified logon session does not exist. It may already have been terminated.')

I suppose this has something to do with the login session of the local user of the system, which is used to start my service, although this is typical, as I understood it as a form of super-administrator-superuser, which must have permissions to do anything in system. But when I change the user login credentials to the local administrator, everything works smoothly.

Is there anything I need to change in my service setup for this to work? Or change user security policies of the local system? Or should I ask users to start this service with the local administrator credentials?

+5
source share
1 answer

, Windows Server 2003 Windows, .

keyring default backend Windows - Windows Vault, , Windows.

, Win32CryptoKeyring, :

keyring.set_keyring(keyring.backend.Win32CryptoKeyring())

API Win32, , , Windows Vault. , . , , .

, Windows Vault Windows Server 2003. Windows , Windows Server 2003 .

Win32CryptoKeyring Windows , , .

+3

All Articles