0

I am trying to get user profile photo using https://graph.microsoft.com/v1.0/me/photos/240x240/$value

in an Angular applicaiton. I have done setup for redirection URI in azure portal. But I am getting CORS error.It says

Access to XMLHttpRequest at 'https://graph.microsoft.com/v1.0/me/photos/240x240/$value' from origin 'https://example.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.*

Where as same thing works from postman

Jacopo Sciampi
  • 2,990
  • 1
  • 20
  • 44
  • maybe it would be better if your backend handles the profile photo request, not the frontend, with that, no CORS will happen – Andres2142 Jun 08 '23 at 17:17
  • Does this answer your question? [No 'Access-Control-Allow-Origin' header is present on the requested resource—when trying to get data from a REST API](https://stackoverflow.com/questions/43871637/no-access-control-allow-origin-header-is-present-on-the-requested-resource-whe) – jub0bs Jun 08 '23 at 18:05

1 Answers1

0

Your application is in development mode that why you are seeing this issue. You will not face this in prod mode. For development purpose use any cors google chrome plugin.

https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf

Sourabh Chopade
  • 498
  • 5
  • 13