FortiClient
FortiClient proactively defends against advanced attacks. Its tight integration with the Security Fabric enables policy-based automation to contain threats and control outbreaks. FortiClient is compatible with Fabric-Ready partners to further strengthen enterprises’ security posture.
Anil_Solakoglu
Article Id 274594
Description This article describes how to verify users when connected to cloud and on-premise domains in different names with regex.replace() on Azure.
Scope

Fortinet EMS Server.

Important: Azure AD integration is only possible starting from the v7.2.1 EMS version.
UPN transformation is no longer needed as of v7.2.3 EMS. 
EMS now UPNs with different domain names rather than the imported ones, as long as the SAML attributes contain the right user UPN.

Solution

To set up a configuration for user verification, adhere to the instructions in these related documents:

Configuring user verification with SAML authentication and an Azure AD server user account.

Adding an Azure AD server.

 

Consider a scenario where there is a hybrid domain with Azure and the intention is to utilize SAML to validate FortCllient users that are already linked to the local domain that is synchronized with Azure AD.

 

Domain name used locally: @contoso.com

Microsoft Azure domain: @contoso.onmicrosoft.com

 

Attributes for UserPrincipalName will not match.

Only the specific Domain Identification field on Azure can be read by EMS.  

 

Anil_Solakoglu_0-1695169486556.png

 

On the Enterprise Application of Azure side, check single sign-on edit.

 

Anil_Solakoglu_1-1695169486558.png

 

Select the specific field:

 

Anil_Solakoglu_2-1695169486559.png

 

Once the edit window opens for a specific attribute:

 

Transformation: regex.replace()

Regex Pattern: (?'user'^.*?)(?i)(\@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$

Replacement Pattern: {user}@contoso.com 

 

Anil_Solakoglu_3-1695169486563.png

 

It will replace the existing domain configurations, such as:

 

anil@contoso.onmicrosoft.com -> anil@contoso.com

 

Anil_Solakoglu_4-1695169486564.png

 

Next, save the configuration.