Azure / static-web-apps-cli

Azure Static Web Apps CLI ✨

Home Page:https://aka.ms/swa/cli-local-development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom SWA roles don't work in Data API builder

itpropro opened this issue · comments

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 Azure/data-api-builder#2074, as I don't know where this should be tracked.

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