I am working on a Atom Package which needs to authenticate with StackExchange through Implicit OAuth 2.0.
The problem is, that I never did OAuth before and am not sure what is the best way to implement.
Allow users to authenticate with StackExchange using OAuth.
My theoretical implementation:
- Open port on localhost:PORT and listen
- Call default browser to open stackexchange.com authorization webpage.
- On completion redirect to localhost:PORT
- Extract received key, reply to the browser to the close tab.
- Close localhost:PORT server.
Can anyone suggest whether it is a legit way of implementing OAuth, or there are better solutions available?
Thank you for your help!