Discourse SSO with OAuth2

When someone logs into Your website, the only talking that happens is in between GitHub and your website.

I.e.
Your website calls github to ask if a user exists in their user database
Github responds yes (or no) and returns user data or authentication token as requested by your site.
Now, the user gets logged in to your site.

There is no play of discourse here in the equation. What you need here is some way to tell discourse that the given user has just logged in and needs to be logged into discourse as well.

What You need is a way to enqueue discourse login along with your website login so that discourse knows when a user has logged in/out.

Auth0 does this pretty well out of the box…
Another way is to use discourse as your SSO server.