Base solution for your next web application
Open Closed

Access to XMLHttpRequest from origin has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource #8052


User avatar
0
TPATax created

Hello, in a first place, I know that this issue has been discussed here multiple times, but none of the answers we've found helped us.

We get this type of console error Access to XMLHttpRequest at 'http://api-hr.janbranny.eu/api/TokenAuth/Authenticate' from origin 'http://hr.janbranny.eu' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. But this error occurs randomly, on different requests. Most of the time server returns response with CORS headers, but sometimes (when this occurs) the response is not available - does not have headers (see provided attachments).

To the example (attachments): GetDemandDetail (OPTIONS) and GetDemandDetail (GET) are OK. SwitchToLinkedAccount (OPTIONS and POST) are fine too. LinkedAccountAuthenticate (OPTIONS) is OK. LinkedAccountAuthenticate (POST) returns status 200 but does not contain any response.

You can find Logs.txt here: https://drive.google.com/file/d/1v-EETR1jdbm0Yjr_p2-nTw9ELcUJMH_t/view?usp=sharing . The first described GetDemandDetail (OPTIONS) request starts at time 17:23:04.

Thank you in advance for your support.

<br>


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team
    Request origin http://api-hr.janbranny.eu does not have permission to access the resource.
    

    Please share your CORS configuration.

    If you set AllowAnyOrigin, will this error occur?

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because it has not had recent activity for a long time.