X-Git-Url: http://www.project-moonshot.org/gitweb/?p=gssweb.git;a=blobdiff_plain;f=navigator.gssweb.js;h=0ff0f137352eb85ec96990a0e35027051e47fc34;hp=a72fa87dc695138c8351a1364e51a1ee26585677;hb=2006e2d4a7eece6f6e7563116a3fa8879ae517f4;hpb=6d773ffb25a1a916a36f4aab238700984e393f67 diff --git a/navigator.gssweb.js b/navigator.gssweb.js index a72fa87..0ff0f13 100644 --- a/navigator.gssweb.js +++ b/navigator.gssweb.js @@ -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({ @@ -124,7 +119,7 @@ var GSSWeb = (function () { }; if ("" != this.clientCred) { - params.claimant_cred_handle = this.clientCred; + params.cred_handle = this.clientCred; } if ("" != this.serverToken) { params.input_token = this.serverToken; @@ -135,20 +130,23 @@ var GSSWeb = (function () { this.gss.init_sec_context(params); }; + GSSWeb.prototype.sendTokenToServer = - function (ctxt, - mech_type, - output_token, - ret_flags, - time_rec, + function (data, app_tag) { - this.clientToken = output_token; - this.context = ctxt; + this.clientToken = data.output_token; + this.context = data.context_handle; - var data = "nonce=" + this.nonce + + var msg = "nonce=" + this.nonce + "&token=" + encodeURIComponent(this.clientToken); - this.xhr.send(data); + this.xhr.open("POST", this.serverPath, true); + this.xhr.setRequestHeader( + 'Content-Type', + 'application/x-www-form-urlencoded' + ); + this.xhr.send(msg); }; + GSSWeb.prototype.recvTokenFromServer = function () { // Only care when we're ready if (this.xhr.readyState != 4) {