I want to create an application to read Stack Overflow notifications on my device.

My question: what should I provide in the OAuth Domain and Application website fields while registering the application?

  • Depends but it would be a domain name you have control over and your application website (probably also on that domain) – rene Apr 22 at 17:16
  • I am running it from my browser precisely. So, would domain be localhost? And secondly, can I put my blog url as application website? @rene – user69015 Apr 22 at 17:18
  • 1
    Yeah, I have localhost for an app where I have a client side oauth flow. You an use any url for application website, even your profile here on SO if you have no blog. – rene Apr 22 at 17:22

If you need something for personal use, it doesn't really matter. You can even use example.com, as long as the site doesn't redirect and change the URL. You'll need a browser and a tool like curl. Insert the client ID of the application in the URL below:

https://stackoverflow.com/oauth?client_id=[CLIENT ID]&scope=read_inbox,no_expiry,write_access,private_info&redirect_uri=https://example.com

This will redirect you to https://example.com/?code=[CODE] (note: the code ends with two closing parentheses which are part of the code).

Then, use that code (and the client ID and secret)

curl -d "client_id=[CLIENT ID]&client_secret=[CLIENT SECRET]&code=[CODE]&redirect_uri=https://example.com" -X POST https://stackoverflow.com/oauth/access_token

which will give you a response with your access token as follows:

access_token=[ACCESS TOKEN]
| improve this answer | |

You must log in to answer this question.