• Accessing REST WS Issue

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #44618  by olw
 
Hi, I have been trying to access the REST WS from React (using Javascript fetch library) and got this error message.
Code: Select all
Fetch API cannot load http://xxx.xxx.x.xxx:8080/OpenKM/services/rest/auth/login. Response for preflight has invalid HTTP status code 401
When i don't have cross-origin resource sharing enabled, this is the error I got:
Code: Select all
Fetch API cannot load http://xxx.xxx.x.xxx:8080/OpenKM/services/rest/auth/login. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 401. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
But when i tried sending the request from Postman, it does work.
Can anyone please help me solving this issue?

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.