Integrating Forma Cloud
Integrate with other applications and automate users maintennce
I/O Task Integration
When to use IO Task Integration
IO Task Integration is designed to connect Forma LMS with external business systems through asynchronous file exchange (e.g., CSV, XML) on a shared SFTP folder.
This approach is particularly suitable when:
- The external system does not expose APIs or only provides limited ones
- The integration needs to be simple, robust, and batch-based
- Real-time data synchronization is not required
- Large volumes of data need to be processed on a scheduled basis
When real-time interaction or event-driven logic is required, API-based integrations are recommended instead.
Use Cases
Typical use cases for IO Task Integration include:
- Automatic user import from HR systems,
- Automate user status and profiles update
- Bulk enrollment into courses or learning plans
- Data exchange with external systems (e.g., training completion records)
Check the official documentation for a full guide to the available connectors
Custom I/O activities may be analyzed and implemented upon request
Integration Flow
The typical IO Task integration flow works as follows:
- The external business system generates a data file
- The file is placed in a shared folder
- Forma LMS processes the file through the configured IO Task
- Data is imported or updated within the platform
File Management and Shared Folders
Shared Folder
File Upload to Forma Cloud
All files used for data exchange must be placed in a shared SFTP folder provided by Forma Cloud with the following path: html/files/common/iofiles
Your SFTP credentials are published in your client area, or you can ask our helpdesk team
Please verify that your systems can:
- automatically generate files in the required format
- transfer them to the shared folder (e.g., via SFTP or similar services)
File Retrieval from client system
If your system cannot automatically send files to the Forma Cloud shared folder, it is possible to:
- expose the files on a customer-managed shared folder (e.g., you company SFTP)
- request an additional service from the Forma team to automatically retrieve the files
⚠️ This additional service involves extra cost.
File format
The data file must comply with the following requirements:
- The file format must be .csv (mandatory)
- There are no strict constraints on the column separator (e.g., comma, semicolon, etc.), as long as it is consistent within the file
- Additional columns are allowed and will be ignored if not mapped in the IO Task configuration
- The column order is not strictly required during the initial setup
Once the integration procedure has been configured and activated, separator type and column structure must remain consistent over time. Changes to separators, column order or structure may cause errors in data processing.
Scheduling
The I/O task cron job is usually processed nightly at 2 am
Data Specifications
Users import and update
Creating and updating users
- Username: The username is the user's primary identifier and must be unique (e.g., the employee ID number, tax code, etc) and remain consistent over time, even if the user changes roles within the company. All automated operations will be based on this data, so it must be consistent and stable across all applications involved in the integration. It is also important that it is easy for users to remember, for example using the same username as other applications (this will also allow for SSO solutions)
- Email: Use email as forma username only if strictly required, i.e. you need it for SAML/OIDC integration and you still need it to be different from the email used for communications.
- Folder Identifier: define a field to be used to assign users to an org-chart node. Data should match exactly the org-chart code, and won't be saved to the user profile.
- Language: If no language is specified, imported users will use the default language and will see the platform in their default language when they log in. In international contexts, it's a good idea to also import the user's language and ensure the required languages are installed on the platform so they can see the platform in their native language when they log in.
- Password: the procedure can either import a password for each user from the file, or set a default password for all the users (in this case we recommend configuring mandatory password change upon first login). It is possible to send credentials to the newly imported users via email.
- Other user data: define if the system should import other data to user custom fields
Managing Node assignment
- Users can be associated to one or multiple orgchart nodes, based on a code identifying a specific orgchart. One record must be provided for each user-node association
- At every import all the orgchart association for each user will be reset and recreated, thus all users will be constantly added to the current nod association
- Missing Orgchart code: if the code for the imported user is not related to an orgchart code, the user will be placed in the root folder
Suspending users
- Suspension: users removed from the imported file will be suspended on the platform
The IO Task feature will only suspend and won't remove any user
The update procedure can't reactivate suspended users: this is to avoid conflicts with manual users management
Export of users status on courses
This connector will generate a CSV file containing a list of users and their status on courses, and can be integrated with other user information from custom fields.
Enroll users to courses
Upload a CSV file containing a list of users and course codes to automatically enroll users
API Integration
Integrating with Forma Cloud APIs and Postman
Overview
Forma Cloud provides a complete set of REST APIs that allow you to perform the most common operations on users, courses, enrollments, certificates, and reporting.
Forma Cloud uses the standard APIs of Forma LMS.
Official Forma LMS API Documentation:
https://docs.google.com/document/d/1bbNL7AR_2gbescLkgBIL3Cu7BZ9tZLky9spM3bfkZjA/edit?tab=t.0
Common Use Cases
The APIs can be used to integrate the platform with other corporate systems.
HR System Synchronization
- Automatic user creation in the platform
- User profile updates
- Deactivation of terminated employees
HSE Management Integration
- Export of course completion certificates
- Monitoring mandatory training expiration dates
- Synchronization of compliance training status
Business Intelligence & Reporting
- Extraction of course completion data
- Monitoring training KPIs
- Integration with external analytics tools
Corporate Portal Integration
- Single Sign-On (SSO)
- Display of training status in company intranet
- Custom dashboards
In multi-tenant installations, it is strongly discouraged to grant API access to individual sub-clients. Doing so may expose sensitive data across different tenants, increasing the risk of privacy breaches and unauthorized access. To ensure proper data isolation and security, API usage should be restricted to controlled and centralized contexts.
Enabling the APIs in Forma Cloud
APIs can be enabled and configured directly from your platform.
Configuration Path:
Admin > System Configuration > Settings > API & SSO
Here you can:
- Enable API access
- Configure security parameters
- Manage authentication and tokens
- Configure SSO if required (Check the Forma Cloud SSO documentation)
Forma LMS official system configuration guide: https://docs2.formalms.org/books/reference-guide/page/system-configuration
Exporting the Postman Collection from Forma Factory
Once your platform's API are activated and configured, From your Client Control Panel you can:
- Export a ready-to-use Postman Collection
- Download the related connection JSON files
- Quickly import API calls into Postman
This avoids manual configuration and speeds up testing.
What is Postman?
Postman is a popular tool for testing and developing APIs in a simple and visual way.
- Send HTTP requests (GET, POST, PUT, DELETE)
- Add headers and authentication tokens
- Manage environments (e.g., production / staging)
- Save collections of API calls
- Write automated tests on responses
It is available as a desktop application and as a web application.
How to Use Postman with Forma Cloud
1. Import the Collection
- Open Postman
- Click Import
- Select the .json file exported from Forma Factory
2. Configure the Environment
Set the main variables:
- base_url
- client_id (if required)
- client_secret or token
3. Authenticate
Use the authentication endpoint to obtain an access token as described in the official documentation.
Execute API Calls
Select the desired endpoint (e.g., users, courses, enrollments) and send the request.
API response standard: the mantained format is JSON. Most API still provide also the legacy XML format, but is now deprecated and will be removed in future releases.
Security & Best Practices
- Always test you API calls on the provided sandbox environment (if not active, just ask the helpdesk ;) ).
- Never share tokens or credentials
- Use separate environments for testing and production
- Limit API user permissions
- Monitor API usage through system logs
Official Resources
- Forma LMS API Documentation:
https://docs.google.com/document/d/1bbNL7AR_2gbescLkgBIL3Cu7BZ9tZLky9spM3bfkZjA/edit?tab=t.0 - System Configuration Guide:
https://docs2.formalms.org/books/reference-guide/page/system-configuration
SSO Features
SSO Integration with Forma Cloud
1. What is Forma Cloud SSO?
The FormaLMS SSO system allows the generation of automatic login links that authenticate the user securely through a temporary cryptographic token. This is a common solution for:
-
Automatic redirect from a web application
-
SSO login links in HTML pages
-
API endpoint returning an SSO URL
This guide explains how to correctly implement Single Sign-On (SSO) authentication with FormaLMS, allowing users to access the platform directly from external systems without entering their credentials.
2. How SSO Works
The SSO login process is based on three elements:
-
login_user – The username of the user who must be authenticated
-
time – A Unix timestamp representing when the link was generated
-
token – An MD5 hash that validates the authenticity of the request
The token is calculated using the username, timestamp, and a shared secret key (SSO Secret).
3. SSO URL Structure
A valid SSO URL follows this structure:
https://PLATFORM/index.php?r=adm/homepage/sso&login_user=USERNAME&time=TIMESTAMP&token=TOKEN
Parameters
-
r=adm/homepage/sso – FormaLMS SSO endpoint
-
login_user – User’s username (URL-encoded)
-
time – Current Unix timestamp
-
token – Uppercase MD5 hash
Example
https://forma.example.com/index.php?r=adm/homepage/sso&login_user=mario.rossi&time=1729681425&token=A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6
4. Generating the SSO Token
Step 1: Generate the Unix Timestamp
The Unix timestamp represents the number of seconds elapsed since Jan 1st, 1970 (UTC).
Examples:
-
PHP:
time() -
Node.js:
Math.floor(Date.now() / 1000) -
Python:
int(time.time()) -
C# (.NET):
DateTimeOffset.UtcNow.ToUnixTimeSeconds() - Java: System.currentTimeMillis() / 1000
Important: The timestamp must be generated dynamically at the moment of the SSO request.
Step 2: Calculate the Token
The token is an uppercase MD5 hash of a specific concatenated string:
token = MD5_UPPERCASE(login_user + "," + time + "," + sso_secret)
Where:
-
login_user = the username
-
time = timestamp from Step 1
-
sso_secret = secret key configured in FormaLMS
Example (PHP)
$loginUser = "mario.rossi";
$time = 1729681425;
$ssoSecret = "mia_chiave_segreta_123";
// Build the string
$stringToHash = $loginUser . ',' . $time . ',' . $ssoSecret;
// Result: "mario.rossi,1729681425,mia_chiave_segreta_123"
// Calculate MD5 and convert to UPPERCASE
$token = strtoupper(md5($stringToHash));
// result: "A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6"
Requirements:
- Commas must match exactly
- No extra spaces
- Final hash must be uppercase
Step 3: Build the Final URL
Once the timestamp and token are ready, construct the final SSO URL:
Example (PHP):
$platformUrl = "https://forma.example.com";
$ssoUrl = $platformUrl . "/index.php"
. "?r=adm/homepage/sso"
. "&login_user=" . urlencode($loginUser)
. "&time=" . $time
. "&token=" . $token;
5. Configuration in FormaLMS
Before using SSO, configure the secret key inside FormaLMS:
6. Link Validity
SSO links are time-limited for security reasons.
Characteristics:
-
Typical validity: 5–10 minutes
-
The link must be used immediately
-
Past or future timestamps are not accepted
-
Expired links require regeneration
Best practices:
-
Generate the link just before redirecting
-
Do not store SSO URLs for future use
-
Implement automatic regeneration if needed
7. Implementation Checklist
Configuration
-
Secret key configured in FormaLMS
-
Secret matches the one used in external system
-
HTTPS enabled
Token Generation
-
Timestamp is a Unix timestamp
-
Timestamp generated per request
-
String format:
username,time,secret(commas required) -
MD5 hash converted to uppercase
-
No extra spaces
URL
-
r=adm/homepage/ssois present -
Username is URL-encoded
-
All required parameters included
8. Testing and Verification
Manual Token Test
Verify the token by hashing a test string in the exact format:
username,timestamp,secret
Use any MD5 generator to confirm the result.
Access Test
-
Generate a valid SSO URL
-
Open it in a browser within 5 minutes
-
Confirm the user is logged in
-
Confirm redirection to the homepage
9. Troubleshooting
"Invalid token" or "Access denied"
Check:
-
Matching SSO secret
-
Uppercase MD5 token
-
Correct format (username,timestamp,secret)
-
Existing username in FormaLMS
"Link expired"
Check:
-
Link used within validity window
-
Server clocks synchronized (NTP recommended)
-
Timestamp generated at request time
Redirects to login page
Check:
-
Correct endpoint (
adm/homepage/sso) -
Username properly URL-encoded
-
All parameters present
10. Security
Protecting the SSO Secret
-
Keep the secret strictly confidential
-
Never store it in logs, public repos, or client-side code
-
Use environment variables or secret-management systems
-
Rotate the key every 6–12 months
Protect SSO Links
-
Always use HTTPS
-
Do not send SSO URLs through insecure channels
-
Avoid logging full SSO URLs
-
Implement rate limiting
Monitoring
-
Monitor failed SSO attempts
-
Implement alerts for suspicious activity
-
Periodically audit SSO access logs
11. SSO Variants
FormaLMS supports two SSO endpoints:
1. Standard SSO (username-based)
?r=adm/homepage/sso&login_user=USERNAME&time=TIME&token=TOKEN
Token: MD5(username,time,secret)
2. Custom SSO (email-based)
?r=adm/ssologin/show&email=EMAIL&time=TIME&token=TOKEN
Token: MD5(email,time,secret)
Check which one your installation uses.
12. Full Implementation examples
PHP
<?php
/**
* Generates a valid SSO URL for FormaLMS
*
* @param string $loginUser The username of the user
* @param string $ssoSecret Secret key configured in FormaLMS
* @param string $platformUrl Base platform URL
* @return array Generated SSO data
*/
function generateSSOUrl($loginUser, $ssoSecret, $platformUrl)
{
// STEP 1: Generate current Unix timestamp
$time = time();
// STEP 2: Calculate the token
$stringToHash = $loginUser . ',' . $time . ',' . $ssoSecret;
$token = strtoupper(md5($stringToHash));
// STEP 3: Build the URL
$url = rtrim($platformUrl, '/') . "/index.php"
. "?r=adm/homepage/sso"
. "&login_user=" . urlencode($loginUser)
. "&time=" . $time
. "&token=" . $token;
return [
'url' => $url,
'login_user' => $loginUser,
'time' => $time,
'token' => $token,
'valid_until' => date('Y-m-d H:i:s', $time + 300)
];
}
// Example usage
$ssoData = generateSSOUrl(
'mario.rossi', // Username
'my_secret_key_123', // SSO Secret
'https://forma.example.com' // Platform URL
);
echo "SSO URL: " . $ssoData['url'] . "\n";
echo "Valid until: " . $ssoData['valid_until'] . "\n";
?>
JavaScript (Node.js)
const crypto = require('crypto');
/**
* Generates a valid SSO URL for FormaLMS
*/
function generateSSOUrl(loginUser, ssoSecret, platformUrl) {
// STEP 1: Unix timestamp
const time = Math.floor(Date.now() / 1000);
// STEP 2: Calculate token
const stringToHash = `${loginUser},${time},${ssoSecret}`;
const token = crypto
.createHash('md5')
.update(stringToHash)
.digest('hex')
.toUpperCase();
// STEP 3: Build URL
const baseUrl = platformUrl.replace(/\/$/, '');
const url = `${baseUrl}/index.php?r=adm/homepage/sso`
+ `&login_user=${encodeURIComponent(loginUser)}`
+ `&time=${time}`
+ `&token=${token}`;
return {
url: url,
login_user: loginUser,
time: time,
token: token
};
}
// Example usage
const ssoData = generateSSOUrl(
'mario.rossi',
'my_secret_key_123',
'https://forma.example.com'
);
console.log('SSO URL:', ssoData.url);
console.log('Token:', ssoData.token);
Python
import hashlib
import time
from urllib.parse import quote
def generate_sso_url(login_user, sso_secret, platform_url):
"""
Generates a valid SSO URL for FormaLMS
"""
# STEP 1: Unix timestamp
current_time = int(time.time())
# STEP 2: Calculate token
string_to_hash = f"{login_user},{current_time},{sso_secret}"
token = hashlib.md5(string_to_hash.encode()).hexdigest().upper()
# STEP 3: Build URL
base_url = platform_url.rstrip('/')
url = (f"{base_url}/index.php?r=adm/homepage/sso"
f"&login_user={quote(login_user)}"
f"&time={current_time}"
f"&token={token}")
return {
'url': url,
'login_user': login_user,
'time': current_time,
'token': token
}
# Example usage
sso_data = generate_sso_url(
'mario.rossi',
'my_secret_key_123',
'https://forma.example.com'
)
print('SSO URL:', sso_data['url'])
print('Token:', sso_data['token'])
C# (.NET)
using System;
using System.Security.Cryptography;
using System.Text;
using System.Web;
public class FormaSSO
{
public static string GenerateSSOUrl(string loginUser, string ssoSecret, string platformUrl)
{
// STEP 1: Unix timestamp
long time = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
// STEP 2: Calculate token
string stringToHash = $"{loginUser},{time},{ssoSecret}";
using (MD5 md5 = MD5.Create())
{
byte[] hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(stringToHash));
string token = BitConverter.ToString(hashBytes).Replace("-", "").ToUpper();
// STEP 3: Build URL
string baseUrl = platformUrl.TrimEnd('/');
string url = $"{baseUrl}/index.php?r=adm/homepage/sso"
+ $"&login_user={HttpUtility.UrlEncode(loginUser)}"
+ $"&time={time}"
+ $"&token={token}";
return url;
}
}
}
// Example usage
string ssoUrl = FormaSSO.GenerateSSOUrl(
"mario.rossi",
"my_secret_key_123",
"https://forma.example.com"
);
Console.WriteLine($"SSO URL: {ssoUrl}");
SAML/OIDC Integration
Integration Between Azure Active Directory and Forma Cloud via SAML or OIDC
1. Introduction
The integration between Forma LMS and MS Entra (Formerly Azure Active Directory - AAD) allows users to authenticate into the learning platform using their corporate Office 365 credentials.
Access is managed through standard federation protocols — SAML 2.0 or OpenID Connect (OIDC) — ensuring security, centralized user management, and Single Sign-On (SSO).
2. Prerequisites
-
An active Entra/AAD (Microsoft 365 / Office 365) instance.
-
Administrator access to the MS Entra portal to create and configure enterprise applications.
-
Administrator access to the Forma LMS instance.
-
The SAML or OIDC authentication plugin installed and enabled in Forma LMS.
3. Choosing the Authentication Protocol
| Protocol | Description | Typical Supported IdPs |
|---|---|---|
| SAML 2.0 | XML-based standard protocol widely used for enterprise Single Sign-On. | Azure Active Directory, Microsoft ADFS, Google Identity, Auth0, SimpleSAMLphp |
| OIDC (OpenID Connect) | OAuth 2.0–based protocol, more lightweight and modern, ideal for cloud integrations. | Azure Active Directory, Salesforce, Auth0 |
Note: For Microsoft 365 environments, either SAML or OIDC may be used depending on corporate security policies. Both protocols are supported by the Forma LMS authentication plugin.
4. Configuration via SAML
4.1 Creating the Application in Azure AD
-
Log in to the Azure portal with an administrator account.
-
Navigate to Azure Active Directory → Enterprise Applications → New Application.
-
Select Create your own application → Non-gallery application.
-
Enter a name, e.g., “Forma LMS SAML.”
-
Once created, go to the Single Sign-On section and select SAML as the authentication method.
4.2 SAML Configuration
Within the SAML configuration page, set the following parameters:
-
Identifier (Entity ID): The Entity ID URL provided by Forma LMS (e.g.,
https://yourportal/formalms/saml/metadata.php). -
Reply URL (Assertion Consumer Service URL): The endpoint where SAML assertions are sent (e.g.,
https://yourportal/formalms/saml/acs.php). -
Logout URL (optional):
https://yourportal/formalms/saml/logout.php.
User Attributes Mapping
In the Azure AD application, configure the following attribute mappings:
| SAML Attribute Name | Azure AD Source Attribute | Description |
|---|---|---|
username |
user.userprincipalname |
Unique username |
givenName |
user.givenname |
First name |
surname |
user.surname |
Last name |
email |
user.mail |
Email address |
Additional attributes can be sent, but only those listed above are natively managed by the Forma LMS plugin.
4.3 User Management
-
Automatic Account Creation: Forma LMS can automatically create a user account upon first SAML login if the option is enabled in the plugin settings.
-
Data Synchronization: User data (name, surname, email) can be updated automatically at every login.
-
Access Restriction by Organization Node: SAML login can be restricted to users belonging to a specific organization node or sub-node.
4.4 Assigning Users or Groups
In the Azure portal, within the SAML application:
-
You can enable all Entra/Azure AD users or limit access to specific groups or subgroups.
-
This configuration is managed from the Users and Groups section of the Azure application.
5. Configuration via OIDC
5.1 Creating the OIDC Application in Azure AD
-
Log in to the Azure portal.
-
Go to Entra/Azure Active Directory → App Registrations → New Registration.
-
Configure:
-
Name: “Forma LMS OIDC”
-
Supported account types: “Accounts in this organizational directory only.”
-
Redirect URI:
https://yourportal/formalms/oidc/callback.php.
-
-
After creation, note the following values:
-
Client ID
-
Tenant ID
-
Client Secret (generated under Certificates & Secrets)
-
5.2 Configuration in Forma LMS
In the Forma LMS OIDC plugin, enter the following parameters:
| Parameter | Example Value |
|---|---|
| Client ID | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Client Secret | **************** |
| Issuer URL | https://login.microsoftonline.com/<tenant-id>/v2.0 |
| Redirect URL | https://yourportal/formalms/oidc/callback.php |
| Scopes | openid profile email |
As with SAML, automatic account creation and user data synchronization can be enabled at login.
6. Compatibility
| Protocol | Identity Providers Tested with Forma LMS |
|---|---|
| SAML | Microsoft Azure AD, Microsoft ADFS, Google Identity, Auth0, SimpleSAMLphp |
| OIDC | Microsoft Azure AD, Salesforce, Auth0 |