My project have controllers and API controllers and I have custom HMAC authentication action filter. The problem is that when I am calling action in API controller and user is unauthorized I am getting login page html source code instead of status 401. I want that when user uses my Web Api and when he unauthorized he would get 401 status and when user uses my web application and tries to open page that requires authentication he'd be redirected to login page.
Asked
Active
Viewed 119 times
1 Answers
1
-
But how to check if user made api call or he browsing my website? I've seen examples only for ajax calls. – user2412672 Oct 12 '14 at 16:40