I have an existing Web Api project which works well, I can authorize and run the endpoints in controllers. But when I add a new controller and decorate with [Authorize] attribute as same as others, no matter user is authorized or not, it gives 401 error. When I comment out the [Authorize] decoration, it is accessible. But this situation occurs only on newly added controllers. Even an empty controller. How to solve the problem?
↧