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.