No OTCSTicket in api/v1/auth header
Options
Hi All,
I am trying to authenticate with a otcs through the REST Api. When I send off a request to https://{myserver}/otcs/cs.exe/api/v1/auth with a valid username and password, I receive a StatusCode of 200 OK, but looking through the headers there is no OTCSTicket or ticket to grab in order to send through as authentication for other API calls. Can anybody share some insight on where I am going wrong on this?
var uri = $"https://{myserver}/otcs/cs.exe/api/v1/auth"; var request = new HttpRequestMessage(); request.Headers.Add("Connection", new[] { "Keep-Alive" }); request.Headers.Add("Cache-Control", "no-cache, no-store, must-revalidate"); request.Headers.Add("Pragma", "no-cache"); request.RequestUri = new Uri(uri); request.Method = HttpMethod.Post; request.Content = new StringContent($"username={userName};password={passWord}", Encoding.UTF8, "application/x-www-form-urlencoded"); var httpClientHandler = new HttpClientHandler { Proxy = WebRequest.GetSystemWebProxy(), UseProxy = true, AllowAutoRedirect = true }; using (var client = new HttpClient(httpClientHandler)) { var response = client.SendAsync(request).Result; string ticket; var vals = response.Headers.TryGetValues("OTCSTicket", out IEnumerable<string> temp) ? temp : new List<string>(); if (vals.Any()) { ticket = vals.First(); } return response.Content.ReadAsStringAsync().Result; }
0
Categories
- All Categories
- 109 Developer Announcements
- 49 Articles
- 100 General Questions
- 122 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 122 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management