CORS Error When Accessing Authorize URL Registered Application

Fernando Sanchez 41 Reputation points
2023-03-09T13:19:08.87+00:00

Hi there!

We have created a managed application on Azure to integrate Microsoft Teams with our plattform.

We have made an integration with PHP, and everything works fine when I make the request to authorize from the backend.

When we tried to implement the URL of the backend to our frontend(React Project), it started throwing a CORS Error

Next step, I started to looking for information on the documentation of Azure, not no result was found. I added the referer route to the Redirect URIs of the application, as well as the backend authorization one.

I tried to move both URLs from Web application to SPAs, but no result was found.

Backend url: [http://localhost:9080/api/createMeetingTest]

One more thing, I have disabled the CORS from my browser. It didn't solved my issue.

I would really appreciate your help

Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
112 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,524 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 25,481 Reputation points Microsoft Employee
    2023-03-17T01:01:23.6766667+00:00

    Hi @Fernando Sanchez

    If I understand correctly, you have a managed application you retrieved from the Azure Store that is based in PHP. You're currently using this managed application as a backend and it can successfully call your custom-built frontend. I could be wrong, but your PHP managed application should be based on app services. Under that assumption, you can follow Tutorial: Host a RESTful API with CORS in Azure App Service on how to add CORS to the app service. You can either use the portal or use az webapp cors add --resource-group myResourceGroup --name <app-name> --allowed-origins 'http://localhost:9080/api/createMeetingTest' CLI command.

    0 comments No comments