poulpreben wrote: ↑Aug 19, 2020 10:43 am
Actually, it's even more simple. From the documentation:
It is not required to manually import HTTPBasicAuth.
Just replace your headers with the "auth" parameter:
Code: Select all
r = requests.post("https://10.0.0.100:9398/api/sessionMngr/?v=v1_5", auth=("username", "password"), verify=False)
I tried but no hope. it shows username or password incorrect....
I open chrome, type "
https://10.0.0.100:9398/api/sessionMngr/?v=v1_5", i found that i cannot access. but i can query api using postman with same account.
I can access "
https://10.0.0.100:9443/ using same account....
C:\Users\abc\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py:981: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.0.0.100'. Adding certificate verification is strongly advised. See:
https://urllib3.readthedocs.io/en/lates ... l-warnings
warnings.warn(
401
b'{"FirstChanceExceptionMessage":null,"StackTrace":null,"Message":"The user name or password is incorrect","StatusCode":401,"Status":"Unauthorized"}'
Code: Select all
[log from Veeam]
[19.08.2020 19:38:39] <19> Info License is validated. Status: 'Success', Comment: 'License is valid.'
[19.08.2020 19:38:39] <19> Info Checking the license edition. Current license edition: EnterprisePlus
[19.08.2020 20:19:12] <71> Info [POST] request to [https://10.0.0.100:9398/api/sessionMngr/?v=v1_5] deserialized. Message: [null]; Parameters: [].
[19.08.2020 20:19:12] <71> Info [Authenticated] Logging on...
[19.08.2020 20:19:12] <71> Error Login failed.. RequestUri: [URI template match was not found].
[19.08.2020 20:19:12] <71> Error Authorization header is missing (Veeam.Backup.Interaction.RestAPI.CRestAPICommunicationException)
[19.08.2020 20:19:12] <71> Error at Veeam.Backup.Enterprise.RestAPIService.CWebApiRestOperationContext.GetAuthorizationHeader(HttpRequestMessage request)
[19.08.2020 20:19:12] <71> Error at Veeam.Backup.Enterprise.RestAPIService.CEnterpriseRestSessionManagerControllerStub.<LogInAfterAuthentication>d__2.MoveNext()