Azure / Azure/static-web-apps

App roles not usable in "allowedRoles"

Open
#1,425 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

I'm using custom authentication using an Entra ID application that provides "app roles". I have assigned users to these app roles and can see the role reflected in /.auth/me in the "roles" claim. However, using a route:

```
{
"route": "*",
"allowedRoles": ["My_Custom_Role"]
}
```

I'm getting a 403 error when accessing the static web app.

I saw the tutorials about a custom GetRoles function which I do not implement in my backend. However, my understanding is that this function is only required if you need to access the roles in the backend API. I only need to use the roles in the staticwebapp.json file.

Is that supposed to work, or is the GetRoles function required anyway?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.