I'm trying to connect a piece of desktop software to the Stack Exchange web service through OAuth2. I've read the docs but the problem is that what it talks about is subtly different to what parameters I have available to me.

This is what the interface looks like in my software, and the values I have entered:

software setup dialog

I'm fairly sure the "Authorization Parameters" are correct, and the token URLs, but the whole thing fails. I get a dialog open asking me to login, and I can choose the Facebook option (for example) to do that. But once I enter my details to log in to Facebook, I get the following:

error message popup

The message is "Server refused the connection"

You might think straightaway that the redirect URL is incorrect - which might be so - but most of the other web services that are predefined in my software (eg Box, Dropbox, LinkedIn, Slack, etc) all have localhost as their redirect, so I'm not convinced.

Also, I did try using https://stackexchange.com/oauth/login_success as the redirect, but that just opens a Stack Exchange window, there's no indication of success, and it doesn't return me back to the original desktop tool, which is what should happen.

Anyway, if anyone has any ideas, that would be appreciated! Even just suggestions where to experiment or what section of the documentation to check would help. At the moment I just don't know where to investigate because I don't know which bit is failing, or why.

  • What software are you using? Where is that dialog from? Jun 6 '17 at 23:38

What software are you using?

Anyway, for a Desktop app, you almost always use the "Implicit" (Client side) procedure.

  1. Configure your Stack app as shown in this answer.
  2. That dialog appears to be set for "Implicit" (server side) OAuth. Unless it is acting as -- or on -- a full web server, this is incorrect. Attempt to set it for client side OAuth.
  3. In that vein for client-side OAuth, key parameters are:

    • Client ID:                {Your app's Client ID}
    • Client Secret:         Not applicable
    • Redirect URI:         https://stackexchange.com/oauth/login_success
    • Authorization URL: https://stackexchange.com/oauth/dialog?scope=private_info
      (Or use whatever scope is required for your needs.)
  4. Worry about the the "retrieve token parameters" and "refresh token parameters" when the rest of the setup works. Not sure Stack Apps and whatever you are using, are on the same page...

  5. The "API call parameters" setting needs more information. For client side OAuth and most API calls, the parameters should be in the URL (A GET request). But for write operations (editing or creating posts, comments, etc.) then POST is required and Header is correct.

  • Thanks. I'm using a product called FME (www.safe.com). It's basically an ETL tool that can connect to various web services - if you can get the settings right! I'll check out the suggestions in your answer and let you know how it goes. Cheers. Jun 13 '17 at 14:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .