Discourse to Discourse SSO already works out of the box for years.
See Using Discourse as a SSO provider