This class is in my application, but it’s official code from DiscourseConnect - Official Single-Sign-On for Discourse (sso) that I’ve putted in my application to manage SSO
Followed also Incorporating Discourse SSO with Existing Rails Site with Devise - Stack Overflow