While using the refresh token to get an access token through office 365 REST api I made the following Jquery ajax request.
XMLHttpRequest cannot load
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://localhost' is therefore not allowed access.
The response had HTTP status code 404.
http://outlook.office365.com resource supports CORS, so you shouldn't be running into this problem. I found this question on Stack Overflow and the accepted answer suggests that jQuery alters the request so that CORS doesn't work and that you need to edit the request headers before executing it.
Make sure your jQuery request has the correct header.