3

I was recently making an app using the SE API's client-side auth flow. What I noticed is that there was this

Unable to post message to http://localhost. Recipient has origin http://localhost:5000.

So after doing some debugging, I found that https://stackexchange.com/oauth/login_success page, the script which notifies the original page that OAuth was successful has these lines:

    $(function () {
        var domain = 'http://localhost';
        var proxy = 'http://localhost:5000/static/proxy.html';

It looks like the 'domain' is incorrect (as it doesn't have the port), from what I can tell this looks like it is extracting it incorrectly from proxy.

I know that running my server on :80 would fix this but it would be nice to not need to do that.

  • 1
    If you are using a nonstandard port, then you are using a server. You need to use the server-side (explicit) OAuth recipe for that, and it does work. – Awesome Poodles May 12 '18 at 21:49

You must log in to answer this question.

Browse other questions tagged .