We have a windows service built in .net framework 4.7.1 and it running under local system account on my dev machine. On server we installed it under a service account.
We are trying to connect to OT CS and trying to upload files using REST API GET and POST Requests. We have a RESTSharp code which generates OTCSTicket and using that OTCSTicket we are trying to connect to the OT CS but it's throwing an error 401 Authentication Required for both the GET and POST requests.
When the same API call is made through Postman it works fine. We checked the network traffic using fiddler and not seeing any difference between Restsharp call from the code and the postman call except that postman is adding a "Postman token".
Following are the server error logs
08/12/2021 09:14:59 INFO Service error occurred
08/12/2021 09:14:59 INFO Error Code: MemberService.MemberTypeNotValid
08/12/2021 09:14:59 INFO Error Message: Member type not valid
The code works only when we hardcode the postman generated OTCSTicket on my local dev machine. But that same hardcoded ticket is not working on the test server which has Win server 2012 R2 installed. My local DEV machine has Win 10 Enterprise. OT CS is 16.2 Enterprise.
This is extremely urgent as we will miss production deadline and any help would be greatly appreciated.