0

I am writing a python program that can login to my CyberArk using my username, password and Radious OTP and generate a temporary auth token, that i can use in other function. Can anyone please tell me if there is way to integrate my Radious OTP that I am getting from the Authenticator app on my phone to the below code, or if there is any other way of doing it.

Following link is difficult to understand: https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/10.10/en/Content/SDK/CyberArkAuthentication-Logon.htm

import requests

url = "https://<MyServer>//PasswordVault/API/Auth/radius/Logon"

payload = "{\n\t\"username\": \"abcd\",\n\t\"Password\": \"efgh\",\n\t\"useRadiusAuthentication\":\"yes\"\n}"
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
Rio
  • 595
  • 1
  • 6
  • 27
  • Try to append the OTP with a comma to your password. – Alex_P Jan 30 '20 at 22:14
  • no, it says invalid entry then – Rio Jan 31 '20 at 00:42
  • The `content-type` for these requestes are typically 'application/json'. Are you sure your encoding is correct? – Alex_P Jan 31 '20 at 07:56
  • Yes did that already. Not worked either – Rio Feb 02 '20 at 03:33
  • @Rio If you see the official documentation of cyberark https://docs.cyberark.com/Product-Doc/OnlineHelp/PrivCloud/Latest/en/Content/WebServices/GetPasswordValueV10.htm it says don't use rest api inside application other than for human use.. I am not sure why do they mention it – Stunner Feb 04 '20 at 07:56
  • let me know if it is working for u now – Stunner Feb 04 '20 at 07:56

0 Answers0