Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

How to avoid the Windows Security popup and immediately return 401

$
0
0

I created a Web Api 4 Project using Windows Authentication, and then added an [Authorize(Roles="Administrators")] attribute to the Get() Method of the ValuesController. When I try to Access thehttp://.../api/values URL, I am prompted for credentials since I am not a member of the Administrators group. That is not the behavior I want, but rather I just want a 401 immediately. Does anyone know what I need to do to accomplish that?


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

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