Hi,
We have a Rest API feature running on a backend server in this path:
http://CSAdmin/img/csui/widgets/cust_widgets/test/uploadattrs/OT_UI_DATA.html
This is working fine.
The authentication in the API is made via OTDSWS:
$.ajax({
url: "http:// ArchiveServer:8080/otdsws/rest/authentication/headers"
type: "GET",
dataType: "json",
crossDomain: true,
xhrFields: {
withCredentials: true
},
success: function (data) {
ticket = data.ticket;
PostLoadActions();
}
});
}
And the calling to the Rest actions is done like this:
$.ajax({
type: "GET",
url: "http:// CSAdmin /OTCS/llisapi.dll/api/v1/" + strRestAct,
dataType: "json",
crossDomain: true,
xhrFields: {
withCredentials: true
},
beforeSend: function (request) {
request.setRequestHeader("OTDSTicket", ticket);
},
success: function (resp) {
if (intActCode == 4) {
handleNodeInfo(resp);
strErrMsg = "The profile ID is not a valid OpenText Node ID";
}
},
error: function (e) {
alert('Error: \n' + e.statusText + "\n" + strErrMsg);
}
});
----------------------------------------------------------------------------------------------------------
All was working well until we moved the API to the FrontendServer.
This is the error message from the tomcat at the clustered env:
HTTP Status 401 – Unauthorized
________________________________________
Type Status Report
Description The request has not been applied because it lacks valid authentication credentials for the target resource.
________________________________________
Apache Tomcat/8.5.14
This is the new structure in the cluster:
API URL
http://CSFrontEnd/img/csui/widgets/cust_widgets/test/uploadattrs/OT_UI_DATA.html
Authentication url:
http:// CSAdmin:8080/otdsws/rest/authentication/headers - this server name was taken from the login URL to the frontEnd CS
Rest Actions url:
http:// CSFrontEnd /OTCS/llisapi.dll/api/v1/" + strRestAct,
Also in the IIS of the FrontEnd we added these Response Headers:
Access-Control-Allow-Origin = "http:// CSAdmin:8080/*"
Access-Control-Allow-Credentials = "true"
----------------------------------------------------------------------------------
What should I add in the new clustered structure to make the authentication work again?
Thanks
Yaron