SAML Integration
Integrate with identity providers such as Azure AD, Okta, and Google Workspace via the SAML 2.0 protocol
SAML (Security Assertion Markup Language) is a standard authentication protocol widely adopted by enterprise-grade applications.
Target audience: Enterprises that have deployed a SAML identity provider (such as Microsoft Entra ID / Azure AD, Okta, Google Workspace)
Key advantages:
Industry-standard protocol with high compatibility
Identifies users by Email and automatically creates an account on first sign-in (only the Email and display name are read; groups, departments, and other attributes are not)
Integrates with multi-factor authentication (MFA)
Supports Single Logout (SLO)
Setup Steps
1. Fill in IdP Information in the MaiAgent Backend
After selecting the SAML authentication type, first fill in the Authentication Source Name (used to generate SP endpoint URLs, for example my-company), then provide the IdP settings using one of the following two modes. The two modes cannot be filled in at the same time; the form cannot be saved if both are provided.
A: Metadata URL
IdP Metadata URL
The IdP provides a publicly readable metadata URL (for example, Microsoft Entra ID). When you save, the system downloads and parses it, automatically obtaining the Entity ID, SSO URL, and certificate; if MaiAgent cannot reach this URL, the form cannot be saved
B: Manual setup
IdP Entity ID, IdP SSO URL, IdP X.509 Certificate (all three fields are required)
The IdP only lets you download a metadata file and has no metadata URL (for example, Google Workspace). For the certificate, paste the base64 content between BEGIN CERTIFICATE and END CERTIFICATE in the PEM
Email Domain is optional: once set, members whose Email uses this domain are automatically redirected to this SAML sign-in when they enter their Email on the sign-in page.
2. Obtain SP (MaiAgent Side) Information
After you fill in the authentication source name, the system automatically generates the following SP information, displayed on the settings page:
Entity ID
https://{domain}/accounts/saml/{name}/metadata/
Provided to the IdP for configuration
ACS URL (Assertion Consumer Service URL)
https://{domain}/accounts/saml/{name}/acs/
Provided to the IdP for configuration
Login URL
https://{API domain}/auth/saml/{name}/login/
SAML sign-in entry point
Each of the three values has its own purpose: the Entity ID is the name by which the IdP identifies MaiAgent; the ACS URL (Assertion Consumer Service) is the address to which the IdP sends the signed SAML response after the user signs in successfully at the IdP, and where MaiAgent verifies it and completes the sign-in. The IdP only sends to pre-registered addresses, so paste it exactly as is (including the trailing /); the Login URL is the entry point where users start SSO sign-in and does not need to be entered into the IdP. For technical details, see the Technical Manual SAML SSO Integration.
3. Configure the MaiAgent Application in the Identity Provider (IdP)
Using Microsoft Entra ID (Azure AD) as an example:
Sign in to the Azure Portal > Microsoft Entra ID > Enterprise applications
Click New application > Create your own application
Select "Integrate any other application you don't find in the gallery (Non-gallery)"

Select the enterprise application you just created

Open the enterprise application and click Single sign-on > SAML on the left

In the Basic SAML Configuration section, enter the MaiAgent SP information:
Identifier (Entity ID): Enter the Entity ID generated by MaiAgent
Reply URL (Assertion Consumer Service URL): Enter the ACS URL generated by MaiAgent
Save the settings
4. Get the Values from the IdP and Fill Them Back into MaiAgent
At the bottom of the Azure AD Set up Single Sign-On with SAML page, find the following information and, according to the mode in Step 1, fill in one of the sets into the SAML settings form in the MaiAgent backend:
A (recommended)
App Federation Metadata Url
IdP Metadata URL
B
Microsoft Entra Identifier
IdP Entity ID
B
Login URL
IdP SSO URL
B
"Certificate (Base64)" downloaded from the SAML Certificates section
IdP X.509 Certificate
When using Mode A, fill in only the IdP Metadata URL and leave the other three fields empty.

5. Assign Users and Groups
In the Azure AD enterprise application, click Users and groups > Add user/group, and add the employees or groups that need access to MaiAgent.

6. Save and Confirm
Click the Save button in the MaiAgent backend, and the Confirm Authentication Method Change window appears. Make sure the IdP-side configuration is complete, then click Confirm Change to finish the setup.
SAML Attribute Mapping
MaiAgent reads only two attributes from the SAML response: Email (required, used as the account identifier) and display name. The mapping rules are fixed and cannot be customized in the backend; other attributes such as groups, departments, and job titles are not read, and roles are not synchronized.
Email: The default output of Microsoft Entra ID and ADFS works as is; for other IdPs, make sure an Email attribute is sent, or set the NameID format to emailAddress. For the three acceptable Email sources and the order in which they are read, see Section 2.2 "User Attribute Mapping" of the Technical Manual SAML SSO Integration.
Display name: Written only on first sign-in, when the account is created; if no display name is sent, the text before the @ in the Email is used instead. Later name changes on the IdP side are not synchronized to MaiAgent.
Other SAML IdP Settings
MaiAgent's SAML integration is not limited to Microsoft Entra ID. Any identity provider that supports the SAML 2.0 standard can be integrated. Common IdPs include:
Okta: Add a SAML 2.0 App under Applications
Google Workspace: Configure under Admin Console > Security > SSO
ADFS: Add under Relying Party Trusts; for full steps, see ADFS Integration
The logic is the same: enter MaiAgent's SP information (Entity ID, ACS URL) into the IdP, then fill the IdP's information back into MaiAgent. If a Metadata URL is available, fill in only the Metadata URL (Mode A); otherwise, fill in the Entity ID, SSO URL, and X.509 certificate (Mode B).
SAML Security Features
Supports SAML 2.0 HTTP Redirect Binding
Session Index tracking to ensure sign-out operations are correct
NameID format uses emailAddress to ensure consistent user identification
Sign-in cookie settings:
Secure=True,SameSite=None,HttpOnly=True, with a validity of 5 minutes
Settings Quick Reference
Authentication Source Name
Yes
Lowercase letters, digits, and hyphens; max 31 characters
my-company
IdP Metadata URL
Required for Mode A
HTTPS URL
https://login.microsoftonline.com/.../federationmetadata/2007-06/federationmetadata.xml
IdP Entity ID
Required for Mode B
URI
https://sts.windows.net/{tenant-id}/
IdP SSO URL
Required for Mode B
HTTPS URL
https://login.microsoftonline.com/{tenant-id}/saml2
IdP X.509 Certificate
Required for Mode B
Base64 content between BEGIN / END CERTIFICATE in the PEM
MIID...
Email Domain
No
Domain format
company.com
Last updated
Was this helpful?