I am trying to integrate Disqus SSO in my site.
var DISQUS_SECRET = "xyz";
var DISQUS_PUBLIC = "abc";
var disqus_developer = 1;
function disqusSignon() {
var disqusData = {
id: "{{ user.id }}",
username: "{{ user.username }}",
email: "{{ user.email }}"
};
var disqusStr = JSON.stringify(disqusData);
var timestamp = Math.round(+new Date() / 1000);
var message = window.btoa(disqusStr);
var result = CryptoJS.HmacSHA1(message + " " + timestamp, DISQUS_SECRET);
var hexsig = CryptoJS.enc.Hex.stringify(result);
return {
pubKey: DISQUS_PUBLIC,
auth: message + " " + hexsig + " " + timestamp
};
}
var data = disqusSignon();
function disqus_config(){
this.callbacks.afterRender = [function() {
this.page.remote_auth_s3 = data.auth;
this.page.api_key = data.pubKey;
}];
}
var disqus_config = function() {
this.page.remote_auth_s3 = data.auth;
this.page.api_key = data.pubKey;
}
var disqus_shortname = 'askpopulo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
Every thing is fine, the payload that is getting generated is also validated correctly on Disqus SSO debug tool. Still the user is not getting signed in using SSO.
And also this message is getting printed on the javascript console:
It looks like there was a problem: Error: Not enough data {stack: (...), message: "Not enough data"}message: "Not enough data"stack: (...)get stack: function () { [native code] }arguments: nullcaller: nulllength: 0name: ""prototype: StackTraceGetter__proto__: function Empty() {}set stack: function () { [native code] }arguments: nullcaller: nulllength: 1name: ""prototype: StackTraceSetter__proto__: function Empty() {}proto: dr.DiscoveryApp.a.Model.extend.onComplete @ discovery.bundle.fce1a5edaced8a1898cef54c2d9fb2bf.js:2(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9p @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9o @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9e @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9p @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9o @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9c @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9p @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9o @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9c @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9p @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.j