Comment implémenter Discourse Connect dans un projet java

I am a beginner and am now learning about implementing single sign-on to the Discourse service from my own java project. How should I do it? Is there any demo?