I am in the process of setting up a flow similar to oauth, where I delay sending an actual request until some initial negotiation has been completed.
The initial negotiation is successful, however, when I attempt to make the request for the desired resource, I encounter the following issue:
- The django server registers a POST request for each step in the negotiation.
- The angular client registers an OPTIONS and a POST request for each step in the negotiation.
Everything seems fine up to this point.
Then, I receive an OPTIONS request for the resource. This request remains pending in the browser while the $http's request function triggers the error
callback with a status of 0.
An error message from angular pops up saying: failed to load resource.
Here is the request object I am passing to $http:
cache: false
data: null
headers: {
Authorization: OAuth realm="all"oauth_consumer_key="21846675797"oauth_signature_method="PLAINTEXT"oauth_token="89676366323"oauth_timestamp="1376236699"oauth_nonce="dQBGqqTQf"oauth_signature="GET&localhost%3A16080%2Fkauth%2Ftest%2F&oauth_consumer_key%3D%2221846675797%22%26oauth_nonce%3D%22dQBGqqTQf%22%26oauth_signature_method%3D%22PLAINTEXT%22%26oauth_timestamp%3D%221376236699%22%26oauth_token%3D%2289676366323%22"
}
method: "GET"
params: null
url: "localhost:16080/kauth/test/"
I removed all standard headers out of concern that they might disrupt my signature:
$http.defaults.headers.common = {};
$http.defaults.headers.get = {};
$http.defaults.headers.post = {};
$http.defaults.useXDomain = true;
The django server does not log anything for this specific request.
Any advice or guidance on this matter would be greatly appreciated.