4

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?

3
  • Depends but it would be a domain name you have control over and your application website (probably also on that domain)
    – rene
    Commented Apr 22, 2020 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
    Commented Apr 22, 2020 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
    Commented Apr 22, 2020 at 17:22

1 Answer 1

4

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]

You must log in to answer this question.