I have created 2 applications one in C# and another in react to access D365FO data entities using OAuth2.0 authorization code + PKCE approach for authentication. I am able to access OData entities with application created using C#. But when I use react application to connect with F&O OData entities. I receive CORS error. Note - I am able to access the entities using postman. When I was looking out information on the yammer posts , I came across this post , There is no proper solution provided for this yammer post as well. I would like to know if anyone has tried accessing D365FO data entities with react application , is it supported and do we have solution for CORS error.
Access D365FO Odata Entities or Custom services using java script, react application
Hi,
Not sure why this is happening, can you provide more information (e.g. request information, etc.) to help us better resolve the issue? Here's how you can try to fix it:
Make sure the F&O server is configured to allow requests from the domain where your React app is hosted. This may require you to configure the FO server.
Set up a proxy server to forward requests from your React app to Dynamics 365 F&O. This actually bypasses the restrictions of CORS, because there is no cross-domain problem between servers.
Implement middleware, which should allow requests from your React app's domain.
Best regards,
Kevin
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.