The following forum(s) have migrated to Microsoft Q&A (Preview): Azure Active Directory!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
CORS issue after publishing On-Premise application on Azure to integrate with ADFS RRS feed

  • Question

  • After registering Legacy MVC application on Azure AD, MVC applications are throwing "Access to XMLHttpRequest at 'https://login.microsoftonline.com/.....' (redirected from https://abc.xyz.com/......) from origin (redirected from https://abc.xyz.com) has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. This error is impacting most of the Legacy MVC applications. Please let me know if there is an easy workaround for this problem.

    Application is set for no-cache. But when i disable browser cache manually, Application works. 

    • Edited by GuptaVipin Tuesday, December 11, 2018 8:20 PM
    Saturday, December 8, 2018 9:32 PM

Answers

  • We created 2 applications on Azure with following external URLs for same website because we wanted to have 2 tiles on my apps portal with different name. So Now If Ajax request goes with session cookie created for first URL to get data from second URL  which is different application for Azure and expecting different session cookie for that. Since cookie is not valid for second URL, Azure is redirecting the request to login.microsoftonline.com which doesn’t serve Ajax request coming from different origin and this is leading into CORS issues for browser.

    Once I deleted the #1 URL and just kept the second URL which is root URL for application. CORS issue doesn’t appear. Problem got solved but had to create dashboard which has multiple tiles for that application.

    #1

    https://abc.xyz.com/abcd/ah/CI/Index/

    #2

    https://abc.xyz.com/abcd/

    • Marked as answer by GuptaVipin Saturday, December 15, 2018 8:00 PM
    Saturday, December 15, 2018 8:00 PM

All replies

  • Please suggest if i can setup CROSS domain Policy at Azure AD. i think, It should fix the issue.
    Sunday, December 9, 2018 12:49 AM
  • We created 2 applications on Azure with following external URLs for same website because we wanted to have 2 tiles on my apps portal with different name. So Now If Ajax request goes with session cookie created for first URL to get data from second URL  which is different application for Azure and expecting different session cookie for that. Since cookie is not valid for second URL, Azure is redirecting the request to login.microsoftonline.com which doesn’t serve Ajax request coming from different origin and this is leading into CORS issues for browser.

    Once I deleted the #1 URL and just kept the second URL which is root URL for application. CORS issue doesn’t appear. Problem got solved but had to create dashboard which has multiple tiles for that application.

    #1

    https://abc.xyz.com/abcd/ah/CI/Index/

    #2

    https://abc.xyz.com/abcd/

    • Marked as answer by GuptaVipin Saturday, December 15, 2018 8:00 PM
    Saturday, December 15, 2018 8:00 PM