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
{{ message }}
Repository navigation
FakeAuthorizationService also fails authorization against OperationAuthorizationRequirement - please add support #1720
I am unable to use the FakeAuthorizationService with my unit test as it always fails authorization regardless of other configuration.
Method in question is: public Task AuthorizeAsync(ClaimsPrincipal user, object? resource, IEnumerable requirements)
Looking at the code, there is no specific logic for this type of authorization requirement so it falls to the last else statement which returns a failure.
Add logic that supports simulating successful authorization of these types of IAuthorizationRequirements.
My best alternative for now is that I think I'm going to have to either override your method or create a custom FakeAuthorizationService and inject it.
Activity
linkdotnet commentedon May 31, 2025
Hey hey @mpeckatwork
By any chance do you have a minimal repro (your component under test and the test itself) to make our lives easier? That would be really appreaciated.