2017-06-02 51 views
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 using verify=False and DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL'

上面的代碼是內聯提供的文件,但服務器拒絕我auth的請求,並出現以下錯誤:

{"errorCode":"400","errorMessage":"Invalid Username or Password"} 

在您跳槍之​​前,我檢查並重新檢查了我的憑據,然後再次檢查了幾次。 我的憑據是正確的

是否有我在做什麼錯誤?

附加信息:SEPM版本:{"version":"12.1.6168.6000"}

回答

1

末到本方,但我是有幾乎雖然繞了一個有點不同了同樣的問題。所以我的問題最終是我的密碼中的特殊字符。處理事件的賽門鐵克管理員身份驗證的其餘方法不知道如何處理某些特殊字符,以便返回400語法錯誤。嘗試從你的密碼拉特殊字符,並保持在15個字符以下。

祝你好運。