You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using .NET 6.0, but since I am following the .NET 5.0 structure with a separate Startup.cs and Program.cs I used this link as a reference. Thanks in advance for any help. BTW, I saw where Labels can be added but I was not able to add them.
I have a custom policy that I have added to my common library. Something like this.
Then in my razor page, in my client project, I have the following. This works. A forbidden error is thrown if you do not have the ManageUsers policy.
@attribute[Authorize(Policy = " ManageUsers")]
But when I added logic in my Web.Server.Startup.cs like this, I never get the forbidden error. Since I am using BlazorWebAssembly I think I need to add this logic to Web.Client.Program.cs instead but I am not sure how.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using .NET 6.0, but since I am following the .NET 5.0 structure with a separate Startup.cs and Program.cs I used this link as a reference. Thanks in advance for any help. BTW, I saw where Labels can be added but I was not able to add them.
I have a custom policy that I have added to my common library. Something like this.
Then in my razor page, in my client project, I have the following. This works. A forbidden error is thrown if you do not have the ManageUsers policy.
But when I added logic in my Web.Server.Startup.cs like this, I never get the forbidden error. Since I am using BlazorWebAssembly I think I need to add this logic to Web.Client.Program.cs instead but I am not sure how.
This is how my current Web.Client.Program.cs is structured
Beta Was this translation helpful? Give feedback.
All reactions