none
How to enable CORS on SharePoint online site RRS feed

  • Question

  • We have 2 domains. One is SharePoint domain and other is a Azure VM where we have hosted a set(folder) of files(images, CSS and scripts) on IIS(say scorm domain).

    We can access the files on scorm domain from SharePoint online site. There is a javascript file in scorm domain which tries to access SharePoint online site and tries to get/update different lists. We are facing permission issues while doing so. The error message we are getting is as below.

    XMLHttpRequest for https://siteurl/_api/web/lists/getbytitle('listname')/items?$filter=(CourseID eq 'C1188') and (EmployeeName eq 'username') required Cross Origin Resource Sharing (CORS).

    listname is a list in SharePoint online site. CourseID and EmployeeName are columns in Records List.

    The response text/status/status text while trying to do a GET operation is as follows.

    responseText : " {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}}"

    status : 403

    statusText :"Forbidden"

    We have tried enabling CORS by using $.support.cors = true and using crossDomain = true in headers for the GET operation but didn’t help.

    Can you please suggest a solution to solve this issue?

    Monday, January 30, 2017 3:52 AM

Answers

All replies