Skip to content

Instantly share code, notes, and snippets.

@Stevoisiak
Last active November 22, 2021 21:28
Show Gist options
  • Save Stevoisiak/447a8930311fdb64872f44d4239c9df1 to your computer and use it in GitHub Desktop.
Save Stevoisiak/447a8930311fdb64872f44d4239c9df1 to your computer and use it in GitHub Desktop.
Python script to log on to Kronos WFC using the XML API
# Logs on to Kronos WFC using an XML request
# Written as an example for https://stackoverflow.com/a/46776518/3357935
import requests
url = "http://localhost/wfc/XmlService"
headers = {'Content-Type': 'text/xml'}
data = """<Kronos_WFC version = "1.0">
<Request Object="System" Action="Logon" Username="SomeUsername" Password="SomePassword" />
</Kronos_WFC>"""
# Login to Kronos and print response
session = requests.Session() # preserve login cookies across requests
response = session.post(url, data=data, headers=headers)
print(response.text)
@diminuco
Copy link

Do you know how to reset a password via the API?

@Stevoisiak
Copy link
Author

Stevoisiak commented Feb 15, 2019

Do you know how to reset a password via the API?

I don't think you can directly reset a user's password with the API.

According to the Developer Toolkit Reference Guide, you can force a user to reset their password on login with the UserAccount tag if you set PasswordUpdateFlag to True.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment