Hi,
I am facing CORS issue when trying to access REST WS of openKM from another application hosted on different port.
I can access simple file hosted on http://localhost:8081/xyz.xml but unable to access openKM REST service
I am facing CORS issue when trying to access REST WS of openKM from another application hosted on different port.
Code: Select all
ERROR:
$http.defaults.headers.common['Authorization'] = 'Basic ' + Base64.encode('okmAdmin' + ':' + 'admin');
$http.get('http://localhost:8081/OpenKM/services/rest/folder/getChildren?fldId=8c910ef3-2075-49ba-9e83-7237d4ee45fd').then(
function(value) {
alert('success value' + value);
}, function(reason) {
alert('failure value'+reason);
}, function(value) {
}
Code: Select all
I have added CORS Filter to Web.xml of Tomcat but its still not working.XMLHttpRequest cannot load http://localhost:8081/OpenKM/services/rest/folder/getChildren?fldId=8c910ef3-2075-49ba-9e83-7237d4ee45fd. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 401.
I can access simple file hosted on http://localhost:8081/xyz.xml but unable to access openKM REST service