Hi all, we recently migrated our OpenText to new environment (Azure tenant actually). And an old proven method of getting LLCookie stopped working. Nothing is being returned when we Post. This is the code (C#), I am trying to execute, and CookieContainer is empty :-(. Any help would be very much appreciated.
var url = "https://<baseurl>/otcs/cs.exe";
var cookieContainer = new CookieContainer();
var loginUri = new Uri(url);
using (var httpClientHandler = new HttpClientHandler
{
CookieContainer = cookieContainer,
AllowAutoRedirect = true,
UseCookies = true,
})
{
using (var httpClient = new HttpClient(httpClientHandler))
{
// Create a login form
var body = new Dictionary<string, string>()
{
{ "func", "ll.login" },
{ "username", privateLinkUserName },
{ "password", privateLinkPassword },
};
var content = new FormUrlEncodedContent(body);
var request = new HttpRequestMessage(HttpMethod.Post, loginUri)
{
Content = content,
};
var response = httpClient.SendAsync(request).Result;
var cookies = cookieContainer.GetCookies(loginUri).Cast<Cookie>().ToList();
var cookie = cookies.FirstOrDefault(x => x.Name == "LLCookie");
}
}