+
+ GSSEap.prototype.init_sec_context = function (params)
+ {
+ /* variables */
+ // internal variables
+ var nonce;
+
+ // Required parameters
+ var target_name = params.target_name;
+ var callback = params.success || this.success;
+
+ // Optional & defaulted parameters (some are defaulted at lower layer)
+ var context_handle = params.context_handle;
+ var cred_handle = params.cred_handle;
+ var mech_type = params.mech_type;
+ var req_flags = params.req_flags;
+ var time_req = params.time_req;
+ var input_token = params.input_token;
+
+ var error = params.error || this.default_error;
+ var app_tag = params.app_tag || this.appTag;
+
+ /* Error checking */
+ // Call an error if we don't have the required parameters.
+ // - name
+ // - success()
+ if ( "undefined" == typeof(target_name) ||
+ "undefined" == typeof(callback) )
+ {
+ error(-1, -1,
+ "init_sec_context called missing either target_name or success callback"
+ );
+ return;
+ }
+
+ /* Setup */
+ nonce = navigator.generateNonce();
+
+ /* Main processing */
+ // Save our callback, method name, and error function
+ this.callbacks[nonce] = callback;
+ this.errors[nonce] = error;
+
+ // Now pass the request on to the C code
+ window.postMessage({
+ "method":"gss_init_sec_context",
+ "arguments":
+ {
+ "target_name": target_name,
+ "context_handle": context_handle,
+ "cred_handle": cred_handle,
+ "mech_type": mech_type,
+ "req_flags": req_flags,
+ "time_req": time_req,
+ "input_token": input_token
+
+ },
+ "cookies":
+ {
+ "navigator_gss_tag": nonce,
+ "app_tag": app_tag
+ }
+ }, "*");
+
+ };
+
+ GSSEap.prototype.display_name = function(params)
+ {
+ /* Variables */
+ // required parameters
+ var input_name = params.input_name;
+ var callback = params.success;
+
+ if ( "undefined" == typeof(name) ||
+ "undefined" == typeof(callback) )
+ {
+ error(-1, -1,
+ "import_name called missing either name or success callback"
+ );
+ return;
+ }
+
+ var error = params.error || this.default_error;
+ var app_tag = params.app_tag || this.appTag;
+
+ /* Setup */
+ nonce = navigator.generateNonce();
+
+
+ /* Main processing */
+ // Save our callback, method name, and error function
+ this.callbacks[nonce] = callback;
+ this.errors[nonce] = error;
+
+ // Now pass the request on to the C code
+ window.postMessage({
+ "method":"gss_display_name",
+ "arguments":
+ {
+ "input_name": input_name,
+ },
+ "cookies":
+ {
+ "navigator_gss_tag": nonce,
+ "app_tag": app_tag
+ }
+ }, "*");
+
+ }
+