0

Using the code functionality in the link Code to authenticate SharePoint online users using javaScript. I am facing an issue that- ajax call for Microsoft Login service which uses a soap request , returning an error

XMLHttpRequest cannot load https://login.microsoftonline.com/extSTS.srf. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '//--my sharepoint-public site--//' is therefore not allowed access.

when I tried the ajax call using fiddler its working fine. but embedding the code in page is giving me an error. Any help will be highly appreciated.

  • Preflight request to the server - causing the issue- unable to resolve that . – user27178 Jul 1 '15 at 10:45
  • Your first problem is Same-origin policy – eirikb Jul 1 '15 at 11:10
  • Thanks for reply @eirikb -although the login service and my sharepoint online site both resides on https- what else should i check or make change to make it work – user27178 Jul 1 '15 at 11:58
  • I don't think extSTS.srf supports CORS, I'm not sure what the author of your link used for testing, we could perhaps ask him: @pholpar ? I found another solution using RST2.srf, but judging from the comments it seems to have the same problems. – eirikb Jul 1 '15 at 12:18
  • @eirikb i tried with RST2.srf but no result. Comments on the above link is indicating that it was working with most of the user. Hitting the service from fiddler giving me the expected result , but from browser it is throwing error. – user27178 Jul 1 '15 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.