Skip to main content
2 of 3
added 21 characters in body; edited tags
ᔕᖺᘎᕊ
  • 4.4k
  • 2
  • 16
  • 37

JavaScript SDK-based workflow never pushes message back from OAuth login_success page on Stack Exchange side

I'm using the JavaScript SDK by Stack Exchange provided with the latest API, and despite following the official instructions & examples it doesn't work - it seems there is a bug which breaks the workflow, and I believe it's on Stack Exchange's side.

The issue is that https://stackexchange.com/oauth/login_success never gets information about success/error of the authorization workflow, it just stays on the "Authorizing Application" step, never going further.

Further investigations show a Chrome Console output showing us a Uncaught TypeError: Cannot read property 'msie' of undefined jQuery error on Stack Exchange's login_success page:

login_success?assisted=8723&protocol=https&proxy=https://zendesk.mvink.me/integrations/stackexchang…:122 Uncaught TypeError: Cannot read property 'msie' of undefined
    at HTMLDocument.<anonymous> (login_success?assisted=8723&protocol=https&proxy=https://zendesk.mvink.me/integrations/stackexchang…:122)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at Function.ready (jquery.min.js:2)
    at HTMLDocument.K (jquery.min.js:2)
(anonymous) @ login_success?assisted=8723&protocol=https&proxy=https://zendesk.mvink.me/integrations/stackexchang…:122
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
ready @ jquery.min.js:2
K @ jquery.min.js:2

Looking into the source code, it seems you are using $.browser.msie && $.browser.version which has been deprecated in jQuery 1.9, and you are currently using jQuery 1.12 on this page.

// IE technically supports postMessage, but does a *really* bad job of it
if (window.postMessage && !($.browser.msie && $.browser.version <= '9.0')) {
    // modern browsers
    window.opener.postMessage(window.location.hash, 'https://zendesk.mvink.me');
} else {

The result is - success action is never passed to the host window (the one auth process has been called from), so it's not possible to get an access token back.

Please have a look into this.