Last active
November 22, 2021 21:28
-
-
Save Stevoisiak/447a8930311fdb64872f44d4239c9df1 to your computer and use it in GitHub Desktop.
Python script to log on to Kronos WFC using the XML API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 setPasswordUpdateFlag
to True.