Reputation: 671
I have the problem that even though I set the $http.defaults.headers.common.Authorization
to null
I am still capable of accessing the [Authorize]
part of my Web API 2.0 application.
This problem doesn't arise when I start the application from scratch and try to retrieve the data via an initial GET request. This is when I get an error from the $http
callback function.
Any guesses why this is happening? I am quite confident that the bearer token is stored somewhere in the browser and doesn't get deleted properly ...
Chrome (With bearer token):
Chrome (Without bearer token):
Internet Explorer (no bearer Token attribute):
First of all, the authentication property in IE is completely missing. Second, in Chrome everything works perfectly. In IE I have the issue that I can't erase the token for the logout request. The login part with the summary of the regions [Authorize]
part works perfectly.
Upvotes: 0
Views: 3828
Reputation: 327
Try to check the request that have been set, if any Authentification header is there. Also try to verify that you are using the [Authorize]
attribute from System.Web.Http
and not System.Web.Mvc
Upvotes: 1
Reputation: 1209
Make sure you haven't also configured jQuery to do this, via something like $.ajaxSetup
Upvotes: 1