Skip to content

Instantly share code, notes, and snippets.

@lite1979
Created May 14, 2018 20:46
Show Gist options
  • Save lite1979/3257d154fde2323ab7b9b4a7b78a94f7 to your computer and use it in GitHub Desktop.
Save lite1979/3257d154fde2323ab7b9b4a7b78a94f7 to your computer and use it in GitHub Desktop.
/// Authentication setup ///
qz.security.setCertificatePromise(function(resolve, reject) {
//Preferred method - from server
$.ajax("../Scripts/qz/assets/signing/digital-certificate.txt?2018").then(resolve, reject);
});
qz.security.setSignaturePromise(function(toSign) {
return function(resolve, reject) {
//Preferred method - from server
$.ajax({
type: "POST",
url: getURL("AdminService.asmx/getCertificate"),
data: "{'message':'" + toSign + "'}",
contentType: "application/json; charset=utf-8",
dataType: "text"
}).then(resolve, reject);
//Alternate method - unsigned
//resolve();
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment