Azure / static-web-apps-cli

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

Debug the roles function using the local auth emulator #364

Open simonaco opened 2 years ago

simonaco commented 2 years ago

Is your feature request related to a problem? Please describe. Enable local dev for role management through serverless functions

Describe the solution you'd like Test programmatically assigned roles in local environment

Describe alternatives you've considered Call the auth function locally with something like Postman to ensure it responds with the right roles given an input. Use the local emulator to set custom roles at login to test how your app works with different roles.

Additional context Tutorial: Assign custom roles with a function and Microsoft Graph

simonaco commented 2 years ago

https://github.com/Azure/static-web-apps/issues/481

AverageCakeSlice commented 2 years ago

Related to #306

manekinekko commented 2 years ago

I will look at this post-GA.

The current workaround is to print a warning if we detect the auth in the staticwebapp.config.json

oneolddev commented 2 years ago

What is the current status of this? I was attempting to enable role management and test locally. I expected my GetRoles function to be called but it wasn't after login. I was able to call GetRoles directly. I was hoping not to debug in a live SWA deployment.

I'm using SWA CLI ver 1.01 and C#(.net6).

Reshmi-Sriram commented 2 years ago

Hi @c0g1t8, We have this in our radar and will be working on this shortly. We do not have a timeline yet to commit this, but you should be seeing some update in a couple of months.

cc// @sgollapudi77

amatracaru commented 1 year ago

Is there any update on this?

ghost commented 1 year ago

I'd like to second this - any progress so far? At the moment trying to debug is not possible for me, as issues only seem to occur in prod, and not on a local dev machine.