Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
hi, i have an authentication problem with the rest api.
I made the same http request with postman and i have two possible response (200 or 401).
How this is possible?
This is the tomcat access log:
10.0.0.61 - - [07/Jul/2016:14:39:00 +0200] POST /Thingworx/Things/prova/Services/getData?data=hello&appKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx HTTP/1.1" 401 1192
10.0.0.61 - - [07/Jul/2016:14:39:01 +0200] POST /Thingworx/Things/prova/Services/getData?data=hello&appKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx HTTP/1.1" 200 167
Thank you.
The TW Authentication process it's a bit weird...
Few things:
Hello,
Are you saying you see one or the other of those two responses per each request, or that somehow two responses are coming back to you?
Is the HTTP/1.1 a part of the request?
Thanks!
Tori
The first.
After restarting tomcat all works, but I don't understand what the problem was.
Thanks.
Even when logging into the browser the authentication dialog box pops up twice, typically, prompting for authentication when there are no active sessions for that user. I'm not entirely sure why that occurs, but that is consistent with the behavior you are seeing when sending that initial REST request as well. I've submitted a JIRA to R&D regarding this issue and this article will be used to update the status of that JIRA.
Meghan