在Cyber​​Ark上使用RestAPI生成身份验证令牌

时间:2020-01-30 01:24:45

标签: python cyber-ark

我正在编写一个Python程序,该程序可以使用我的用户名,密码和Radius OTP登录到Cyber​​Ark,并生成一个临时身份验证令牌,可以在其他功能中使用该令牌。谁能告诉我是否有办法将我从手机上的Authenticator应用程序获得的Radius OTP集成到以下代码,或者是否有其他方法可以实现。

以下链接难以理解: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'))

0 个答案:

没有答案