Authorization failing for GET requests, SessionID missing
After an update of our OTRS to version 7.0.16 we cannot get any tickets by PyOTRS anymore.
Creating and updating tickets is still working.
The error message for ticket_get_by_id
is as follows:
pyotrs.lib.APIError: Failed to access OTRS API. Check Username and Password! Session ID expired?! Does Ticket exist?
OTRS Error Code: TicketGet.AuthFail
OTRS Error Message: TicketGet: Authorization failing!
After a time of debugging I found out that for GET requests the SessionID is not retrieved by OTRS. The problem is that the SessionID and other values are send as body data from PyOTRS like for POST and PATCH.
Actually this is not the recommended way for GET requests as parameters should be contained in the Request-URI.
The used requests library provides the params
keyword argument for passing parameters in URLs
(see docs).
So for PyOTRS GET requests in _send_request
should thus be called like this:
requests.request("GET",
url,
headers=headers,
params=payload,
proxies=self.proxies,
verify=self.https_verify,
cert=self.client_auth_cert,
auth=self.auth)
It would be glad, if you could confirm and test this.
Maybe there could be at least a setting for sending GET with payload as params instead of as data.
We hope you can provide an updated release soon, so we can use PyOTRS again with our OTRS instance.
Thanks.