We used to connect to OpenText server through the REST API. It worked well as long as we used Active Directory authentication. However, after migrating to Azure AD, the following .Net code (that used to work) returns an “Invalid user/password” error:
Using our new Azure “username” and “password” in the code below:
Dim reader As StreamReader = Nothing
Dim oRequest As HttpRequestMessage = Nothing
Dim oHTTPClient As HttpClient = Nothing
Dim oResponse As HttpResponseMessage = Nothing
oRequest = New HttpRequestMessage(HttpMethod.Post, "HTTPS://****/api/v1/auth")
postData = "username=" & username & "&password=" & password
oRequest.Content = New StringContent(postData, Text.Encoding.UTF8, "application/x-www-form-urlencoded")
oHTTPClient = New HttpClient
oResponse = oHTTPClient.Send(oRequest)
reader = New StreamReader(oResponse.Content.ReadAsStream())
responseFromServer = reader.ReadToEnd()
At this point, “responseFromServer” is {""error"":""Invalid username/password specified.""}