Azure / static-web-apps-cli

Azure Static Web Apps CLI ✨
https://aka.ms/swa/cli-local-development
MIT License
594 stars 117 forks source link

Custom SWA roles don't work in Data API builder #807

Closed itpropro closed 6 months ago

itpropro commented 6 months ago

Custom roles (all except authenticated and anonymous) don't work with the Data API builder permission model and always return AUTH_NOT_AUTHORIZED. Tested with identity provider azureActiveDirectory in swa config and authentication provider StaticWebApps in db config.

Duplicate of https://github.com/Azure/data-api-builder/issues/2074, as I don't know where this should be tracked.

seantleonard commented 6 months ago

Answer provided on other issue. Continuing conversation there.

Hi @itpropro,

In your GraphQL request, make sure to include the HTTP header: X-MS-API-ROLE with value custom-reader

For more details with examples, see https://learn.microsoft.com/azure/data-api-builder/authorization#user-roles