I'm trying to add a header to all http requests sent by angular ($resource used to access a REST server), to add Basic Auth information (from the user input username/password).
I thought it was as simple as $http.defaults.headers.common['Authorization'] = value; (where value is the correctly formatted auth info) when the user hits the login button, but when the requests are sent a 403 Unauthorized is returned, and inspecting the requests in Chrome's network tab the header is not set on a simple resource query.
I have been searching for a while now, there are several questions referring to this that suggest CORS is the problem (it is not, I have the correct headers set on the server side and have also tried running with web safety off in chrome just to double check that this wasn't interfering). Other answers suggest using an interceptor, but that seems to me to be very over-engineered for such a simple task (although if it is the only way I guess I'll have to use it).
EDIT: Additional information: I am convinced CORS is not the issue, as requests to the same server that do not require authentication succeed and return the expected responses. This is a problem with the Authorization header not being set correctly (or at all).