Discourse is a great app, it has some default authentication strategies that work just fine but probably you want to integrate it with your main site existing users base. Here it comes doorkeeper at the rescue, providing a simple way to make an oauth provider of your app. The next step is to add the discourse-doorkeeper-sso plugin to discourse and you’re ready to rock.
Want to try it? Get the code and read the detailed howto on the project page