Single sign-on

Single sign-on

Overview

Single sign-on (SSO) is an authentication process that allows users to access multiple applications using a single set of login credentials. The platform supports SSO through several providers, including Google Workspace, LDAP, and Microsoft 365/Office 365. You can also configure SSO using SAML 2.0, Auth0, or OAuth identify providers, or set up a custom integration. 

Google Workspace

The Google Workspace integration allows you to leverage your existing Google Workspace accounts for the purposes of single sign-on. For more details on how to configure Google Workspace, visit the Google Apps article.

LDAP

LDAP (Lightweight Directory Access Protocol) is a popular way for organizations to store account information for authentication and other purposes. The platform can integrate with your LDAP server for authentication and optionally for account creation. For more details on how to configure LDAP, visit the LDAP article.

SAML 2.0

SAML (Security Assertion Markup Language) is an XML-based, open-standard data format for exchanging authentication and authorization data between an identity provider and a service provider. The SAML 2.0 single sign-on integration allows users to sign-in to the platform through an Identity Provider (IdP). For more details on how to configure SAML 2.0, visit the SAML 2.0 SSO article

Microsoft 365/Office 365

To configure the Microsoft 365/Office 365 SSO login:

  1. Click Admin from the primary navigation menu.
  2. Click App center from the fly-out menu.
  3. Install the Microsoft Entra ID app from the Authentication section. 

Admin, App center, Authentication section with the Microsoft Entra ID app highlighted

After the app is installed:
  1. Click the Configure Configure icon icon on the app tile.
  2. Enter your Microsoft Office 365 domain.
    1. Note that you can enter multiple domains separated by a comma.
  3. Click Save
Admin, Single sign-on, Office 365 Configure page

Once single sign-on with Office 365 is enabled, additional options display:

  1. Select the Auto create account if it doesn't exist checkbox if you would like to allow Office 365 SSO to auto-create accounts on your learning platform if they don't already exist.
    1. If enabled, this feature will create a new learner account using the first name, last name, and email address from Office 365.
  2. Click Edit to edit the SSO domain information.
  3. Click Disable to disable the Office 365 SSO.

Admin, Single sign-on, Office 365 Status page with Office 365 SSO enabled

After enabling SSO with Microsoft Office 365, a new button displays on the Log in pop-up that allows users to log-in using their Offie 365 credentials.  

Visitor portal, Log in pop-up with the Log in with Office 365 button highlighted

Auth0 integration

Auth0 allows you to authenticate and authorize apps and APIs with any identity provider running on any stack, any device, or in the cloud. Auth0 makes it easy for you to give your users the ability to authenticate with the credentials they are most familiar with.

Configure Auth0

To configure an Auth0 integration with your learning portal, you will need an Auth0 account. As a first step, you need to create an application.

  1. Log into your Auth0 account.
  2. Access the Applications section.
  3. Click the Create Application button.
Auth0, Applications page with the Create Application button highlighted

The Create application pop-up displays.

  1. Name the application.
  2. Select Regular Web Applications.
  3. Click Create.
Auth0, Create application pop-up with the Regular Web Applications button highlighted

The application will be created. Once it is created:

  1. Click the Settings tab.
  2. Complete the form. 
Auth0, Applications, Settings tab with the Settings tab highlighted

  1. In the Allowed Callback URLs field enter the callback URL.
    1. For example -  https://PortalName.matrixlms.com/auth0/login - replacing 'PortalName' with your URL portal name.
    2. You can specify multiple valid URLs separated by a comma. Make sure to specify the protocol, http:// or https://, otherwise the callback may fail in some cases.
    3. Include a URL for the logged in state as well. For example: https://PortalName.matrixlms.com/auth0/logged_in?state=https%3A%2F%2FPortalName.matrixlms.com%2F

Info
Note that if you use a custom URL for your portal, include it in the Allowed Callback URLs field. 

Auth0, Applications, Settings tab, Application URIs section with the Allowed Callback URLs section highlighted

  1. Enter your site's logged out URL in the Allowed Logout URLs field.
    1. For example: https://PortalName.matrixlms.com/log_out/logged_out
  2. Enter your site's URL in the Allowed Web Origins field.
  3. After configuring the application settings, click Save.
Auth0, Applications, Settings tab, Application URIs section with example URLs in the Allowed Logout URLs and Allowed Web Origins fields


The newly created application will be listed in the Applications area.
  1. Click the application.
Auth0, Applications page with the newly created application highlighted


The Application displays.

  1. Click the Connections tab.
  2. Ensure the Username-Password-Authentification setting is toggled on. 
Auth0, Applications, Connections tab with the 'Username-Password-Authentication' Database toggled on and highlighted

The next step is to enable APIs for your app.

  1. Click APIs on the left menu.
  2. Click Auth0 Management API.
Auth0, Applications, APIs with the Auth0 Management API button highlighted

  1. Click the Machine to Machine Applications tab.
  2. Turn the toggle on for your application to authorize APIs for your app.
Auth0, Applications, APIs, Auth0 Management API, Machine to Machine Applications tab with the tab name highlighted

To configure the permissions/scope of your application's API authorization:

  1. Click the down arrow Down arrow next to the Authorized toggle. 
Auth0, Applications, APIs, Auth0 Management API, Machine to Machine Applications tab with the Integration toggle and down arrow icon highlighted

The API permissions display.

  1. Click All if you would like to authorize permission for all APIs.
    1. If you do not want to select All in the Permissions/Scopes section, you can select the following scopes to enable:
      1. read:client_grants
      2. read:users
      3. update:users
      4. create:users
      5. read:users_app_metadata
      6. update:users_app_metadata
      7. create:users_app_metadata
      8. read:clients
      9. read:connections
  2. Click Update.
Auth0, Applications, APIs, Auth0 Management API, Machine to Machine Applications tab with the Integration section expanded and the Select All button highlighted

You can also set up users in Auth0. To set up a user:
  1. Click Users in the User Management section of the left menu.
  2. Click Create User.
Auth0, User Management, Users page with the Create User button highlighted

Enter the details of the user:

  1. Select the database connection to use to authenticate the user.
  2. Enter the user's email address.
  3. Enter the user's password. There is no maximum limit for the password length.
  4. Click Create.

Enabling Auth0 integration

To enable Auth0 integration with your platform, you must first install the Auth0 SSO app. To install the app:

  1. Click Admin from the primary navigation menu.
  2. Click App center from the fly-out menu.
  3. Click Install on the Auth0 SSO app in the Authentication section. 
Admin, App center, Authentication section with the Auth0 SSO tile highlighted

To configure the app:

  1. Click the Configure Configure icon icon on the Auth0 SSO app tile.
Auth0 SSO app tile with the Configure icon highlighted

You will be redirected to the Auth0 tab for Administrator Single sign-on settings.

  1. Click Configure.
Admin, Single sign-on, Auth0 tab, Status page with the Configure button highlighted

The Configure Auth0 page displays.

  1. Enter your Auth0 Domain, Client ID, Client Secret, and Database Name
    1. This information can be located in your Auth0 account, covered in more detail below.
Admin, Single sign-on, Auth0 tab, Configure Auth0 page

To locate your Auth0 Domain, Client ID, and Client Secret:

  1. Login to your Auth0 account.
  2. Click your application.
  3. Click the Settings tab.
    1. Your Domain, Client ID, and Client Secret display.
Auth0, Applications, Application example, Settings tab with the the Name, Domain, Client ID, and Client Secret fields highlighted

To locate your Database name:

  1. Login to your Auth0 account.
  2. Click your application.
  3. Click the Connections tab.
    1. Your database name displays.
Auth0, Applications, Connections tab with the 'Username-Password-Authentication' Database highlighted

Complete the fields in the Configure Auth0 tab in the Admin Single sign-on section of your CYPHER platform.

  1. Enter your Auth0 Domain, Client ID, Client Secret, and Database Name
    1. The Auth0 Domain and Client ID are both mandatory fields.
    2. The Client Secret is optional and is used for changing and verifying email addresses. After you enter the Client Secret you will be able to change the email address in the Auth0 database from your CYPHER platform.
    3. The Database Name is also optional.
  2. Auto-Login: If you enable Auto Login, users can skip the login pop-up and go directly to the Auth0 option. When users click the Log in button, they will be automatically logged-into their account using Auth0.
  3. Silent Authentication: If you enable Silent Authentication, no login pop-up will be displayed when the user is already logged in to Auth0. In this case, they will be automatically logged-into their learning portal. Otherwise, they will get the login pop-up.
  4. When you have finished configuring Auth0, click Save.
Admin, Single sign-on, Auth0 tab, Configure Auth0 page with example values in the Auth0 Domain, Client ID, Client Secret, and Database Name fields

After Auth0 SSO is enabled, users will see a Log in with Auth0 button on the Log in pop-up.



If you would like to disable the Auth0 integration:
  1. Click Admin from the primary navigation menu.
  2. Click Single Sign-on from the fly-out menu.
  3. Click the Auth0 tab.
  4. Click Disable.
Admin, Single sign-on, Auth0 tab with Auth0 enabled and the Disable button highlighted

Changing Auth0 email addresses

If you entered the Client Secret when configuring Auth0 (shown in the screenshot below), you can update your email address in your learning platform, and it will automatically update the email address in the Auth0 database. 

Info
Note that this only works if the old email is in the Auth0 database and the new email is not.

Admin, Single sign-on, Auth0 tab with Auth0 enabled and the Client Secret highlighted

To change your email address:

  1. Click your profile picture in the upper right corner.
  2. Click Edit on your profile page.
  3. Click Info
Profile, Edit pop-up with the Info button highlighted

Your profile information displays.

  1. Update your email address.
  2. Click Save
Profile, Settings page with the Email field highlighted in the Contact section

You will receive a notification when the Auth0 email action is complete.

Automatic notification of a completed Auth0 change_email action

An email will be sent to the new email address, where the user must verify the account.

Auth0 email verification example

The email address will be updated in the Auth0 database.

Auth0, User Management, Users page with an updated email address for an example user

Info
Note that this feature only works in case of individual updates, and not in the case of bulk updates (for example importing the email addresses from a CSV file).

Auto create platform accounts

If enabled, the platform can create new accounts based on a user's Auth0 credentials. To enable the creation of new accounts on your CYPHER learning platform:

  1. Click Admin from the primary navigation menu.
  2. Click Single sign-on from the fly-out menu.
  3. Click the Auth0 tab.
  4. Select the Auto create account if it doesn't exist checkbox.
    1.  If this option is enabled a learner account will be created for visitors who don't have an account on the platform when they log in using the Auth0 SSO and their Auth0 credentials.

In order to create a new account on your platform that contains the visitor's first and last name, you must set up custom fields on Auth0 that contain the given name (first name) and family name (last name) of the user. The fields can be defined for each user individually on their Auth0 profile page. 

Info
If these fields are set up in Auth0, then the new user will be created with a first and last name, otherwise, the platform parses the email address for the new user.

Auth0, User Management, Example user, Details tab

After you add the custom fields to the user's metadata on the Auth0 profile, you can map the fields on your Auth0 configuration page.
  1. Click Admin from the primary navigation menu.
  2. Click Single sign-on from the fly-out menu.
  3. Click the Auth0 tab.
  4. Add the given_name field from Auth0 in the First name field text entry field.
  5. Add the family_name field from Auth0 in the Last name field text entry field.
  6. Click Save.

Now, your platform will create new accounts for visitors with Auth0 credentials. Visitors:

  1. Access your platform.
  2. Click Log in.
  3. Click Log in with Auth0.

If the credentials are verified with Auth0, a new account will be created for the user.

User logged in to the Home dashboard

Auto create Auth0 user when creating news users on your platform

If enabled, the platform can also create new Auth0 user accounts when you add new users to your platform. Before you enable this feature:

  1. Log into your Auth0 account.
  2. Access the Applications section.
  3. Click the Connections tab.
  4. Ensure the Database is toggled on. 
  5. Ensure you have authorized APIs for your app and selected the create:users scope (covered earlier in this article).
Auth0, Applications, Connections tab with the 'Username-Password-Authentication' Database toggled on and highlighted


To enable your platform to create new Auth0 accounts:
  1. Click Admin from the primary navigation menu.
  2. Click Single sign-on from the fly-out menu.
  3. Click the Auth0 tab.
  4. Ensure the Database Name is entered
  5. Select the Auto create Auth0 user when creating new MATRIX user checkbox.
    1. If you enable this feature, you can also select the Require email verification when creating Auth0 user checkbox to require email verification when creating an Auth0 user.
Info
Note that if the user signs up and enters a password, that password is transmitted to Auth0 as it is. If the account is created by an upload, CSV, or another mechanism, then the password is automatically generated and is transmitted to Auth0, and users are required to change the password on the first login.

It's important to note that the platform only creates an Auth0 user account if an email address is available for the profile. It is recommended that you can make email a required field for accounts if you want to enable Auth0 user account creation. To make email a required field:

  1. Click Admin from the primary navigation menu.
  2. Click Accounts from the fly-out menu.
  3. Click the Fields tab.
  4. Select the Email field.
  5. Click Edit.
  6. Click No in the Optional on sign up section. 

OAuth 2.0 SSO

You can now connect to generic OAuth 2.0 SSO providers using OAuth 2.0 for authorization and OpenID Connect (OIDC) for authentication.

Info
Note that OAuth 2.0 is not supported as an organization-level SSO provider.

To use OAuth 2.0, you must first install it from the App center. To install the app:

  1. Click Admin from the primary navigation menu.
  2. Click App center from the fly-out menu.
  3. Click Install on the OAuth 2.0 SSO app in the Authentication section. 

Admin, App center, Authentication section with the OAuth 2.0 SSO tile highlighted

To configure OAuth 2.0 SSO:
  1. Click the Configure Configure icon icon on the OAuth 2.0 SSO tile.
  2. Or, click Admin from the primary navigation menu.
    1. Click Single sign-on from the fly-out menu.
    2. Click the OAuth 2.0 tab.
    3. Click Configure.
The Configure OAuth 2.0 settings display.
  1. Enter the Authorization URL, Token URL, and Userinfo URL from OAuth 2.0.
  2. Enter the Client ID and Client secret from OAuth 2.0.
  3. Silent Authentication: If you enable Silent Authentication, no login pop-up will be displayed when the user is already logged in to OAuth 2.0, in this case, they will be automatically logged-in to their learning portal. 
  4. Click Save.

Admin, Single sign-on, OAuth 2.0 tab, Configure OAuth 2.0 page

Custom single sign-on

The platform also offers a Custom SSO option. To set up a Custom SSO, you must first install the app. To install the app,

  1. Click Admin from the primary navigation menu.
  2. Click App center from the fly-out menu.
  3. Click Install on the Custom SSO app in the Authentication section. 
Admin, App center, Authentication section with the Custom SSO tile highlighted

To configure a Custom SSO:
  1. Click the Configure Configure icon icon on the Custom SSO tile.
  2. Or, click Admin from the primary navigation menu.
    1. Click Single sign-on from the fly-out menu.
    2. Click the Custom tab.
    3. Click Configure.
Admin, Single sign-on, Custom tab, Status page with the Configure button highlighted

The Custom Configure page displays with the following fields:

  • Private key: This is your secret key and only the administrator should know it. It provides a safer way to send data between platforms.
    • Note that if the private key is reset, it needs to be changed with the third party application. Otherwise, users will no longer be able to log in.
  • Remote authentication URL: This is the URL where users will be redirected to log in from the third party platform. This is a mandatory field.
  • Return URL: This is the URL where the user will be redirected if there is a login error. This can be left blank and the user will be redirected to your site.
  • Logout URL: This is the URL where the user will be redirected when they log out. This can be left blank and the user will be redirected to your site.
  • Login button text: This is the text that will appear on the "log in" button. If it's left blank the default text will appear as Log in with another account.
  • Allow account auto-create: Determine if you would like to auto create accounts if an account with a matching user id or email is found in the system.
  • Allow users to change the password: Determine if you would like to allow users to change their password. 
  • After configuring the custom SSO, click Save.
Admin, Single sign-on, Custom tab, Status page with example values in the Private key, Remote authentication URL, and Login button text fields

Users can login in two ways:

  • By clicking the Custom SSO button on the Log in pop-up on your visitor portal (shown in the screenshot below).  
  • From your platform with a link.
    • The URL: your_matrix_portal_url/sso/remote
    • When accessing the URL, the CYPHER platform identifies the business and creates a time stamp valid for 5 minutes. After this the user will be redirected to the Remote authentication URL, with the following information being sent: the business id, business URL, time stamp, and a “from” parameter which can be used to go after a log in at a specific location in the platform( for example: ?from=/teacher_lessons/list/[id] and the user will be sent to the class with the specific id).

Users will be authenticated by the third party at the Remote authentication URL, and the data will be prepared and encrypted to be sent back to your platform.


Visitor portal, Log in pop-up with the Custom SSO button highlighted

PHP

Here is a small PHP example of a code of how you should prepare and send the data:

// get data sent by us
$from = $_GET["from"];
$school_id = $_GET["schoolid"];
$school_url = $_GET["schoolurl"];
$timestamp = $_GET["timestamp"];

// get the private key from your system
$private_key = "d6e461d05af9e17bf8a5a25d2d1d5bcfc54d9579";

// get user username and email
$username = "peter.pan";
$email = "peter.pan@wonderland.com";

// get last and first name - MANDATORY IF THE AUTO-CREATE OPTION IS ACTIVATED
$first_name = "Paul";
$last_name = "Peterson";

// create an array with all the data except the private key
$params = array(
  'from' => $from,
  'schoolurl' => $school_url,
  'schoolid' => $school_id,
  'timestamp' => $timestamp,
  'username' => $username,
  'email' => $email,
  'first_name' => $first_name,
  'last_name' => $last_name
);

$params = array_filter($params);

// first create a string with the array data
$hash_msg = implode('', array_values($params));

// then create md5 hash from the private key and the string that you just created
$hash = md5($private_key . $hash_msg);

// generate the query string
$query_params = array();

foreach($params as $key => $value)
{  $query_params[] = $key . '=' . rawurlencode($value);
}

$query = implode('&', $query_params);

// create the redirect url where the data will be check
$url = $school_url . '/sso/login?' . $query . '&hash=' . $hash;

// redirect back to us
header("Location: " . $url);

?>

JavaScript

Here is a small JS example of a code of how you should prepare and send the data:

const urlParams = new URLSearchParams('');

// get data sent by us
from = urlParams.get('from');
school_id = urlParams.get('schoolid');
school_url = urlParams.get('schoolurl');
timestamp = urlParams.get('timestamp');

// get the private key from your system
var private_key = "";

// get user username and email
var username = "";
var email = "";

// get last and first name - MANDATORY IF THE AUTO-CREATE OPTION IS ACTIVATED
var first_name = "";
var last_name = "";

// create an array with all the data except the private key
var params = {'schoolurl': school_url,'schoolid': school_id,'timestamp': timestamp,'username': username,'email': email,'first_name': first_name,'last_name': last_name};

// if 'from' contains no data, do not add it to the array
if (from != null){
params['from'] = from;
}

// first create a string with the array data
var paramsStr = Object.values(params);var hash_msg = paramsStr.join().replace(/,/g,'');

// then create md5 hash from the private key and the string that you just createdvar hash = md5(private_key + hash_msg);

var urlEncodedData = "";

// create the redirect url where the data will be check
var properties = Object.keys(params);
var size = properties.length - 1;
$.each(properties, function (index, name) {
urlEncodedData += encodeURIComponent(name) + '=' + encodeURIComponent(params[name])
 + (size === index ? '' : '&');
});

var url = school_url + '/sso/login?' + urlEncodedData + '&hash=' + hash;

// redirect back to us
window.location.replace(url);

After this, the CYPHER platform will check if the data is valid and encrypt everything to check if the hashes match. If the user is authenticated, they will be logged into the system. Otherwise, the user will be redirected with an error message to the return URL or to the business URL.

Once you have enabled a Custom SSO, two new buttons will appear. 

  1. Click Disable to disable the custom SSO.
  2. Click Edit to edit the custom SSO settings.
Admin, Single sign-on, Custom tab with a Custom SSO integration enabled

Single sign-on per Organization

The platform allows you to create custom visitor portals for organizations, and determine which single sign-on provider you want to use for the organization portal. 

To use a single sign-on provider for an organization, it must first be installed and configured at the business or school level.

To access the organization to configure SSO settings:

  1. Click Organizations from the primary navigation menu.
  2. Click the Organization name from the fly-out menu. 
Home page primary navigation menu, with the Organizations menu active and displaying a list of organizations

The Organization page displays.

  1. Click Admin from the Organization menu.
  2. Click Portal from the fly-out menu.
Organization with the Admin menu active and the Portal button highlighted

If you have enabled a custom visitor portal for the organization, multiple sections display, including the Single sign-on section (shown in the screenshot below).

If you have not yet enabled a custom visitor portal for the organization, the Add button will display. To learn more about enabling a custom visitor portal for an organization, visit the Organizations article.

Organization, Portal with a custom portal enabled and the Single sign-on section highlighted

The Single sign-on section shows available SSO providers. Available options include:

  1. By default, the Inherit business-level provider option is selected. Selecting this setting means your organization will offer the same SSO provider or providers configured at the business or school level.
  2. Select None if you do not want to offer single sign-on for your organization visitor portal.
  3. Select a specific provider if you would like to offer one specific SSO provider on your organization's visitor portal.
    1. Please note that if you select a specific SSO provider for the organization, you can only choose one provider for the organization.

If you select a specific SSO provider for the organization, the Enabled and Configure columns are populated for the provider.

  1. Click the Configure Configure icon icon in the Configure column to access the SSO provider settings.
  2. The Enabled column shows if a SSO provider is enabled.
Organization, Portal, Single sign-on section with Google Apps selected as a provider and the Enabled and Configure columns highlighted

Additionally, if you select a specific SSO provider, a new tab will appear for the SSO provider.

  1. Click the SSO provider tab.
  2. Click Configure to set up the SSO configuration.
  3. Follow the configuration instructions for the SSO provider that are provided in this article.
Organization, Portal, Google Apps tab with the tab name highlighted

Info
Note: Multi-organization configuration is not available for LDAP.
    • Related Articles

    • SAML 2.0 SSO

      Overview SAML (Security Assertion Markup Language) is an XML-based, open-standard data format for exchanging authentication and authorization data between an identity provider and a service provider. Our SAML 2.0 Single sign-on integration allows ...
    • Profile settings for administrators

      Overview Every user has a profile page that includes various information such as their basic info, their account details, their friends, photos, social media links, and more. Users can have access to different profile information depending on the ...
    • Google Apps

      Overview Our Google Workspace integration allows you to leverage your existing Google accounts for the purposes of single sign-on. In the next sections, we will show you how to configure Google Workspace SSO in order for users to be able to log into ...
    • Best practices for administrators

      Overview The following are recommended best practices for new administrators. Choose a short URL Keep your URL short—ideally fewer than 10 characters. For example, if your company is called 'The Academy of Digital Photography,' a URL like 'ADP' is ...
    • Password settings

      Overview For security reasons every user has a User ID (3+ characters) and a Password (5+ characters). Users can log in with their credentials or they can use the available SSO options if enabled. Add password When users sign up and create accounts ...