Dr_Cox1911
Dr_Cox1911
CC#
Created by Dr_Cox1911 on 10/24/2023 in #help
✅ Put `[Authorize("myPolicy")]` behind feature flag
Thanks! It works! I had to get a custom IAuthorizationPolicyProvider alongside your solution to support Authorize attributes with policies that I don't have defined when the feature is disabled. Works like a charm now
14 replies
CC#
Created by Dr_Cox1911 on 10/24/2023 in #help
✅ Put `[Authorize("myPolicy")]` behind feature flag
That doesn't work either unfortunately, I get AuthorizationPolicy must have at least one requirement.
14 replies
CC#
Created by Dr_Cox1911 on 10/24/2023 in #help
✅ Put `[Authorize("myPolicy")]` behind feature flag
Unfortunately it doesn't work, as I don't even register any services and middleware if the feature is disabled. I get an exception that the auth metadata is defined but no app.UseAuthorization() call is made.
14 replies
CC#
Created by Dr_Cox1911 on 8/10/2023 in #help
❔ WebApplicationFactory and Minimal-APIs
3 replies