def winAuth(epmsrv, username, password, version=None):
    """
        Windows Authentication
        This method authenticates the user to EPM by Windows authentication and returns
        a token that can be used in subsequent Rest API calls.
        After the configured timeout expires, users have to logon again using their
        username and password.
        ***** Not for EPM SaaS use *****
    """
    # build the body of the request containing the credentials
    body = {}
    body['ApplicationID'] = 'Irrelevent'
    logonBody = json.dumps(body)

    # build the header and url
    if version == None:
        myURL = epmsrv + "/EPM/API/Auth/Windows/Logon"
    else:
        myURL = epmsrv + "/EPM/API/" + version + "/Auth/Windows/Logon"
    hdr = {'Content-Type': 'application/json'}

    # make the Rest API call
    urllib3.disable_warnings()
    return requests.post(myURL, headers=hdr, data=logonBody)

        Windows Authentication
        This method authenticates the user to EPM by Windows authentication and returns
        a token that can be used in subsequent Rest API calls.
        After the configured timeout expires, users have to logon again using their
        username and password.
        ***** Not for EPM SaaS use *****
    
Solutions/CyberArkEPM/DataConnectors/CyberArkEPMSentinelConnector/pyepm.py