pingidentity/pingid-python-samples

Retrieving Windows logged on AD user to use with startAuthentication.py?

ThinkCode opened this issue · 0 comments

Thank you so much for the easy to read code. The following code in startAuthentication.py works flawlessly (phone PingID authentication). Could you please provide more information on how we can fetch the username without having the user to enter their username since this is a Windows AD environment and the user is logged in already.

import sys
import pingid

PROPERTIES_FILE = './pingid.properties'

req_body = {
'spAlias': 'web',
'userName': 'username',
}

pingid = pingid.PingIDDriver(PROPERTIES_FILE, verbose=True)
response_body = pingid.call('rest/4/startauthentication/do', req_body)

Any Python code samples for the passwordless article from here https://apidocs.pingidentity.com/pingid-api/guide/pingid-api/pid_c_PingIDapiExamplePasswordless/ ?