Running to authentication success on the Apache module!
authorMark Donnelly <mark@painless-security.com>
Mon, 10 Nov 2014 21:43:26 +0000 (16:43 -0500)
committerMark Donnelly <mark@painless-security.com>
Mon, 10 Nov 2014 21:43:26 +0000 (16:43 -0500)
Changes:
* The test.html script now respects the server path form field,
  rather than insisting on "/gss"
* The server path field now defaults to "/gss/" so that we don't
  get a HTTP 301 (Redirect) return code
* The gssweb object now opens the XHR connection with each message,
  instead of assuming incorrectly that the connection will remain
  open after each XHR response completes.

chrome/test/test.html
navigator.gssweb.js

index c99aba6..22bfde2 100644 (file)
           <label for="authenticate_server_path">Server Path:</label>
           <input name="authenticate_server_path" 
                  id="authenticate_server_path" 
-                 value="/gss" />
+                 value="/gss/" />
         </div>
 
         <button id="authenticate">authenticate</button>
 
       function doAuthenticate() {
         gssweb = gssweb || new navigator.gssweb({
-          serverPath: "/gss",
+          serverPath: document.getElementById('authenticate_server_path').value,
           appTag:     "Authentication Test",
           error:      function(errMsg) {
                         report(errMsg, '#authenticate_response');
index 27163c0..0ff0f13 100644 (file)
@@ -17,11 +17,6 @@ var GSSWeb = (function () {
     this.serverToken = "";
     this.clientCred = "";
     this.xhr = new XMLHttpRequest();
-    this.xhr.open("POST", this.serverPath, true);
-    this.xhr.setRequestHeader(
-      'Content-Type', 
-      'application/x-www-form-urlencoded'
-    );
     this.xhr.onreadystatechange = this.recvTokenFromServer.bind(this);
 
     this.gss = new navigator.gss_eap({
@@ -144,6 +139,11 @@ var GSSWeb = (function () {
 
     var msg = "nonce=" + this.nonce +
                "&token=" + encodeURIComponent(this.clientToken);
+    this.xhr.open("POST", this.serverPath, true);
+    this.xhr.setRequestHeader(
+      'Content-Type', 
+      'application/x-www-form-urlencoded'
+    );
     this.xhr.send(msg);
   };