Enable SSO inside server-side application

Hi, I’m using SAML to make a server-side application. I want to give the user the opportunity to enable SSO inside the application. Just like Salesforce do it: Enable Single Sign-On | Okta . Does anyone knows how Salesforce and other enterprises make this settings page where the use can enable SSO? Is there some SDK we can use for this or?