RusticiSoftware / TinCanJS

JavaScript library for the Experience API (Tin Can API)
http://rusticisoftware.github.io/TinCanJS/
Apache License 2.0
207 stars 115 forks source link

TinCanJS statements work in Chrome but not IE9 #89

Closed jeongl closed 10 years ago

jeongl commented 10 years ago

Is there something extra I have to do to make the library work in IE? When I upload the client side files to a GitHub static page, all the requests seem to fail with 400~ errors.

I tried debugging this piece of code by running it in the browser:

    var tinCan = tinCanConfig();

                    var query = tinCan.getStatements({
                      params: {
                        verb: {
                          id: 'http://adlnet.gov/expapi/verbs/watched'
                        },
                        activity: {
                          id: 'http://example.mp4'
                        },
                        related_activities: false,
                        related_agents: false
                      }
                    });          

console.log('query: ', JSON.stringify(query, null, 2) );

It works fine in Chrome, but IE gives a 400 error in the console:

query: {
  "err": 400,
  "xhr": {},
  "config": {
    "url": "statements",
    "method": "GET",
    "params": {
      "verb": "http://adlnet.gov/expapi/verbs/watched",
      "activity": "http://example.mp4",
      "related_activities": false,
      "related_agents": false
    }
  },
  "statementsResult": null
} 

The response headers from IE read as - HTTP/1.1 401 Unauthorized, though I see my auth string in the request body.

jeongl commented 10 years ago

This seems to be failing authorization. Chrome has the authentication included in the headers, but IE puts the the auth inside the query string. I am also using an LRS that uses X-Experience-API V 1.0.1 if that makes a difference.

brianjmiller commented 10 years ago

Sorry for not seeing this sooner, it sounds like you took the discussion offline with our guys internally so I'm going to close the issue. If you still have questions, please feel free to re-open it. Thanks.