Skip to content

FakeAuthorizationService also fails authorization against OperationAuthorizationRequirement - please add support #1720

@mpeckatwork

Description

@mpeckatwork

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions