My goto when integrating SSO in a Java/JVM application via SAML, OAuth, JWT, and other authentication mechanisms is pac4j (https://github.com/pac4j/pac4j). It has integration to and demos for various web frameworks like Spring and Scala Play. It does a lot of the heavy lifting for integrating SSO into an application.