How to integrate Single Sign-On (SSO) for seamless authentication

Single Sign-On (SSO) is a crucial authentication process allowing users to access multiple applications and services with just one  login credentials. In simpler terms, SSO enables users to log in once and gain access to various systems, applications, or platforms without needing to re-enter their credentials. 

Traditionally, users had to remember separate usernames and passwords for each application they used within an organization. This not only led to password fatigue but also posed security risks due to the proliferation of passwords and the tendency of users to create weak or easily guessable passwords.

 

Here's a step-by-step guide on how to integrate SSO effectively:

  1. Log into your Uteach dashboard and follow the path Settings > Integrations > SSO.

       2. Click on the Custom option and fill in the SSO Login and SSO Register URLs. These are the links you want your users to redirect after logging in or registering.

      3. When users click on the log-in or register buttons, they will be redirected through the links you filled in, adding client_redirect_url with the URL from where the user clicked on the login button.

      4. When the user submits login/register/provider sign-in, you should transfer is_sso and client_redirect_url query parameters to the backend with hidden input or however you prefer.

     5. Send a POST request with “Create user API URL” and Create user API bearer token as a bearer token. You can get the data from here.

If you are using JavaScript, ensure you wait for the response before proceeding.

The request body should be in the following format.

{

 "redirect_url": "https://video.uteach.test/courses", // client_redirect_url which I send 

"user_id": "user id from your system", 

"user_name": "user name", 

"user_email": "[email protected]

}

6.You receive the response in the following format from the POST request. If the response format indicates success, you should redirect user through the URL provided.

 
{ "success": true, 
}
 
If you have any questions about coupons, discounts, or anything at all, send us an email at [email protected] or click the blue icon below to chat :blush: