0
以下是我的代碼:賽門鐵克端點管理器API - 身份驗證問題
import requests, json
proxyDict = {
"http": "<proxy>",
}
base_url = "https://<host_IP>/sepm/api/v1/identity/authenticate"
# if output is required in JSON format
json_format = True
payload = {
"username" : "<username_here>",
"password" : "<password_here>",
"domain" : ""
}
headers = {
"Content-Type" : "application/json"
}
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL' # necessary
r = requests.Session() # Start session in order to store the SessionID Cookie
print json.dumps(payload)
r = requests.post(base_url, proxies=proxyDict, verify=False, headers=headers, data=json.dumps(payload))
strings = r.text
print strings
The
SSL
certificate has some errors, and I am hence usingverify=False
andDEFAULT_CIPHERS += 'HIGH:!DH:!aNULL'
上面的代碼是內聯提供的文件,但服務器拒絕我auth
的請求,並出現以下錯誤:
{"errorCode":"400","errorMessage":"Invalid Username or Password"}
在您跳槍之前,我檢查並重新檢查了我的憑據,然後再次檢查了幾次。 我的憑據是正確的
是否有我在做什麼錯誤?
附加信息:SEPM版本:{"version":"12.1.6168.6000"}