Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12171

DotNet8 WebApi - Newly added controllers with [Authorize] attribute always returns 401 even if user is authorized

$
0
0

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?


Viewing all articles
Browse latest Browse all 12171

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>