Relative Content

Tag Archive for c#swaggerswashbuckle

swagger hide endpoints on specific user

Im trying to hide which endpoints are shown in swagger depending on which users are logged in. This is not working and i don’t understand why. Im using microsoft identity and swashbuckle In the HideEndpointsBasedOnUserFilter class the code is hitting the “if (!isUserInRole)” and goes into this but the commands inside are not removing the swagger endbpoint . Here is my code: