by Manuel Winkel, CTA
As a result of increasing projects, here is a small How To with the following points:
- SAML Authentication (Azure AD as IdP & Citrix Gateway as SP)
- Citrix Federated Authentication Service (FAS)
- Microsoft Azure Multi-Factor Authentication with Conditional Access
Requirements
- Fully working Citrix Virtual Apps and Desktop Environment (StoreFront & DDC Minimum Version 7.9)
- Citrix ADC with successful base configuration & activated Enterprise or Platinum license (Minimum Version 12.1 Build 50+ for native workspace app, for browser Minimum Version 11.1)
- Configured Unified Gateway vServer
- Internal and external DNS entries for Unified Gateway vServer (e.g. citrix.deyda.net)
- Certificates for DNS entries (wildcard certificates are the easiest)
- Existing Azure Tenant with Azure-AD base configuration (Domain, AAD Sync) & activated Azure AD Premium license
- Installed Authenticator App on Test User Mobile Phone
SAML Authentication (Azure AD as IdP & Citrix Gateway as SP)

Active Directory
If the UPN is not the same in Azure AD and in the on-premises Active Directory, the UPN must be modified.
- To do this, open the Active Directory Domains and Trusts tool.

- In the tool, right-click on the top item (Active Directory Domains and Trusts) and select Properties.

- In the following window enter the desired domain (e.g. deyda.net) under Alternative UPN Suffixes and confirm the entry via Add.

- Check that the domain name has been inserted correctly and confirm with OK.

- Now bulk edit or manually adjust the UPN of the required users to the Azure-AD domain.

Azure Active Directory
To connect our upcoming Service Provider, we now need to create a custom application in the Azure Active Directory.
- To configure the Azure Active Directory, log in to portal.azure.com.

- In the Azure Navigation Panel, we click on Azure Active Directory.

- In the Azure Active Directory window, click on Enterprise Applications.

- Now click New Application.

- And then on Non-gallery application.

- In the Add my application window, configure the name of the application visible for the end user, e.g. Citrix FAS and click Add.

- Wait for the application to be created. Information is obtained via the Notifications item at the top.

- Once the application has been created, click on Azure Active Directory > Enterprise Applications > All Applications and then on the application just created (e.g. Citrix FAS)

- In the enterprise application click on Single sign-on.

- Under SSO method click on SAML.


- Click on the pencil icon in the upper area with the number 1 to edit the Basic SAML Configuration.

- Enter here the following:
- Identifier (Citrix Gateway Address, e.g. https://citrix.deyda.net)
- Reply URL (Citrix Gateway Address with /cgi/samlauth, e.g. https://citrix.deyda.net/cgi/samlauth)
- Confirm the input with Save.

- The settings under area 2 User attributes and claims can remain in the existing standard.

- Under SAML Signing Certificate (Area 3), download the Certificate (Base 64) for the Service Provider (Citrix ADC).


- From area 4 (Set up Citrix FAS), copy the displayed URLs (Login URL, Azure AD Identifier & Logout URL) to a local file.

- Click on the confirmation checkbox at the bottom and click Next.
To allow users to use SAML authentication for Citrix, they must be assigned to the application.
- Click on Users and groups.

- Now click on Add user.

- Now select from the list the users who should be granted access (or select all users) and confirm this with Assign.

- I only authorized one test user (user01) for this.

Citrix ADC
Finally, the Citrix ADC must be configured to communicate with the Identity Provider (Azure-AD).

- To do this, we log in to the Admin web interface of the Citrix ADC and navigate to Traffic Management > SSL > Certificates > Server Certificates.

- There, click Install to import the previously downloaded certificate from Azure Portal.

- Enter the following and confirm the entry with Install
- Certificate-Key Pair Name (Unique name for the SAML signature certificate, e.g. SAML-Azure-AD)
- Certificate File Name (Downloaded signature certificate, e.g. Citrix FAS.cer)

- The installed certificate can not be found under Server or Client Certificates, but under Unknown Certificates.

- Then we navigate to Security > AAA – Application Traffic > Virtual Servers to create the SAML Authentication Policy and Authentication vServer.

- Under Authentication Virtual Servers, click Add to create a new vServer.

- Now enter the following:
- Name (Name of the vServer, e.g. Azure-AD_auth_VS
- IP Address Type (Non Addressable)
- Click on OK.

- In the following wizard click on No Server Certificate to connect the server certificate (not the IdP certificate).

- Click in the Click to select area.

- Select the Citrix ADC Server certificate (e.g. my wildcard certificate) and click Select.

- Click on Bind.

- If the certificate is attached (1 Server Certificate) click Continue.

- Under the menu item Advanced Authentication Policies click on No Authentication Policy.

- Click on the + symbol under Select Policy.

- Enter the following:
- Name (Name of the Authentication Policy, e.g. saml_auth_pol)
- Action Type (SAML)
- Expression (HTTP.REQ.IS_VALID)
- Name (Name of the Authentication Policy, e.g. saml_auth_pol)
- Click on the + symbol next to Action.

- Now configure the Authentication SAML Server with the following parameters:
- Name (Name of the SAML Authentication Server, e.g. saml_auth_server)
- IDP Certificate Name (Certificate from the Azure-AD Application, e.g. SAML-Azure-AD)
- Redirect URL (URL for logging in from the Azure AD application, e.g. https://login.microsoftonline.com/…/saml2)
- Single Logout URL (URL for logging in from the Azure AD application, e.g. https://login.microsoftonline.com/…/saml2)
- Signing Certificate Name (Server Certificate of the Citrix Gateway, e.g. my wildcard certificate)
- Issuer Name (FQDN of the Citrix Gateway vServer, e.g. https://citrix.deyda.net)
- Reject Unsigned Assertion (Off)
- Name (Name of the SAML Authentication Server, e.g. saml_auth_server)

- Click on More and edit the following settings
- Signature Algorithm (RSA-SHA256)
- Digest Method (SHA256)
- Signature Algorithm (RSA-SHA256)
- Confirm the entry with Create.

- Check the entries again and click Create.

- Under Policy Binding controls the inputs and changes the following:
- Goto Expression (END)
Confirm this with Bind.

- If the Authentication Policy is connected click on Continue and Done.


In order to complete the configuration on the Citrix ADC, we only need to bind the newly created SAML Authentication Policy to our Gateway Virtual Server.
- To do this, we navigate to NetScaler Gateway > Virtual Servers.

- Select the gateway vServer previously configured for FAS in StoreFront (e.g. https://citrix.deyda.net = UG_VPN_ug_10.0.0.8_443) and click Edit.

Unbind all connected LDAP or RADIUS authentication policy from the vServer.
- Checks that neither a policy is connected in Basic Authentication nor in Advanced Authentication.

- On the right side, click Authentication Profile under Advanced Settings.

- Click on the + symbol under Authentication Profile.

- Enter a name (e.g. saml_auth_profile) under Create Authentication Profile and click on Click to select under Authentication Virtual Server.

- Select the previously created Authentication Virtual Server (Azure-AD_auth_VS) and click Select.

- Confirm the entry by clicking on Create.

- Click on OK and on Done.

- Navigate to NetScaler Gateway > Global Settings to delete the single sign-on domain.

- Click on Change Global Settings.

- Delete the possible entry under Single Sign-on Domain.

- If necessary, the policies of the Gateway vServer must also be adjusted for Single Sign-on Domain.


Citrix Federated Authentication Service (FAS)
Certificate Authority
Next, a PKI environment must be created, if there is none Microsoft Enterprise PKI in the domain. Go for this on the machine that should receive this role. In my example, it is the domain controller itself.
Click through the wizard to the point Server Roles and select the item Active Directory Certificate Services.

- Under the heading Role Services select the following points:
- Certification Authority
- Certification Authority Web Enrollment
- Certification Authority

- If pop-up windows with additional features appear, also confirm these with Add Features.

- Complete the installation with Install.

- Now select the Notifications item in Server Manager
- Click on Configure Active Directory Certificate Services.

- In the following configuration, the default settings can be confirmed with Next.

- Configuration used by me:
- Setup Type (Enterprise CA)
- CA Type (Root CA)
- Private Key (Create a new private key)
- CA Name (Name of the CA, e.g. Deyda-CA)
- Validity Period (5 Years)
- Setup Type (Enterprise CA)
- Confirm the configuration with Configure.

Now the domain controller must be issued a certificate of the local CA.
- To do this, open the MMC on the domain controller.

- Click on File and Add / Remove Snap-in …

- Now click on Certificates and on Add.

- In the following window select Computer account and confirm it with Next.

- Finally, close the window with OK.

- Right-click on Personal and then on All Tasks > Request New Certificate…

- In the Certificate Enrollment window, select Active Directory Enrollment Policy and click Next.


- Select Domain Controller Authentication and confirms this with Enroll.

Citrix Federated Authentication Service
Now we can install and configure the FAS server. In my example, I install the FAS Part on the StoreFront server.
- For this mount the ISO of the used Virtual Apps & Desktops version and start autoselect.exe.
- Then start the installation by clicking on Federated Authentication Service in the following window.

- Click on “I have read, understand, and … ” and confirm it with Next.
- Now confirm the following default settings with Next.

- And click Next again.

- Starts the installation with Finish.


- Maybe have to restart the server.

- To perform the basic configuration of the FAS through the GPO, copy the ADMX / ADML files from the specified path of the FAS server.
C:\Program Files\Citrix\Federated Authentication Service\PolicyDefinitions
- Add them to the PolicyDefinitions Store of the Active Directory.
- Create a new one or edit an existing GPO, which will be activated on the following systems:
- FAS ServerStoreFront ServerVDA Worker
- In the GPO go to the path:
Computer Configuration \ Policies \ Administrative Templates \ Citrix Components \ Authenticatio
n
HKEY_LOCAL_MACHINE \ SOFTWARE \ Policies \ Citrix \ Authentication \ UserCredentialService \ Addresses
Or / And
HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432Node \ Policies \ Citrix \ Authentication \ UserCredentialService \ Addresses
-
- Now start the Citrix Federated Authentication Service Tool with the “run as administrator” parameter
-
- Here is the list of FAS servers that have been configured via GPO. Click on OK.
The following window configures the FAS.
-
- Click on Deploy in the frame Deploy certificate templates
-
- Click on OK, so that the configuration is carried out automatically, in the background.
-
- After successful setup, a green tick appears next to the frame.
-
- Then click on Publish in the second fram Set up a certificate authority
-
- Under Certificate Authority, select the CA configured / created for FAS (e.g. DC01.deyda.local\CA-DEYDA) and click OK.
-
- Upon successful setup, also a green tick appears next to the second frame.
-
- Now click on Authorize at the third frame Authorize this service
-
- Here select the FAS CA and click OK.
-
- Next to the third frame now appears a blinking circle, because the certificate request must be approved.
-
- Reconnect to the server with the FAS CA and open the Server Manager.
-
- In Server Manager, click Tools > Certification Authority.
-
- In the Certification Authority console, click on Pending Requests.
-
- There right click on the request of the FAS server (e.g. DEYDA \ CTX01) and click on All Tasks > Issue.
-
- Thereafter, the certificate appears under Issued Certificates.
The now approved certificate normally expires in 2 years.
It is therefore recommended to include this certificate in the monitoring so that the certificate is renewed before its expiry..
Here are the PowerShell commands to get the expire date (Replace CTX01.deyda.local with FAS server).
Add-PsSnapin Citrix.Authentication.FederatedAuthenticationService.V1
Get-FasAuthorizationCertificate -FullCertInfo -address CTX01.deyda.local
-
- After approving, also a green tick appears next to the third frame
-
- Now click on Create in the frame Create a Rule
-
- Click on Next to create the default rule
-
- In the Template section select Citrix_SmartcardLogon and click Next
-
- In the Certificate authority section select the FAS CA (e.g. DC01.deyda.local\CA-DEYDA) and click Next
-
- Select Allow in-session use if to support double-hop scenarios.
-
- Click on Next
-
- Under Access control click on Manage StoreFront access permissions
-
- In the following window delete the default group Domain Computers.
-
- Then add theStoreFront servers and give them the Assert Identity (Allow) right.
-
- Confirm this with OK.
-
- Confirm with Next
-
- Under Restrictions define the user and the VDA for which certificate authentication via FAS should be allowed

-
- Click on Manage user permissions
Restrict the users who can log in to Citrix via SAML. By default, the group Domain Users is stored here, which can stay that way.
-
- Click on Manage VDA permissions
Under Manage VDA permissions narrow down the list of Citrix Workers to which log in via SAML. By default this stands on Domain Computers, which can stay that way.
After everything is defined click on Next and in the last window on Create
-
- Now all points have a green tick
StoreFront
Now we configure the StoreFront server so that it can talk to the FAS server.
-
- Go to the Citrix StoreFront console and make a note of the store to configure for FAS (e.g. Store).
-
- Starts PowerShell as administrator on a StoreFront server.
-
- Execute the following commands in PowerShell (change the store path in line 2 to store name):
Get-Module "Citrix.StoreFront.*" -ListAvailable | Import-Module
$StoreVirtualPath = "/Citrix/Store"
$store = Get-STFStoreService -VirtualPath $StoreVirtualPath
$auth = Get-STFAuthenticationService -StoreService $store
Set-STFClaimsFactoryNames -AuthenticationService $auth -ClaimsFactoryName "FASClaimsFactory"
Set-STFStoreLaunchOptions -StoreService $store -VdaLogonDataProvider "FASLogonDataProvider"
-
- If to deactivate them again, e.g. for troubleshooting, use the following command:
Get-Module "Citrix.StoreFront.*" -ListAvailable | Import-Module
$StoreVirtualPath = "/Citrix/Store"
$store = Get-STFStoreService -VirtualPath $StoreVirtualPath
$auth = Get-STFAuthenticationService -StoreService $store
Set-STFClaimsFactoryNames -AuthenticationService $auth -ClaimsFactoryName "standardClaimsFactory"
Set-STFStoreLaunchOptions -StoreService $store -VdaLogonDataProvider ""
-
- Now open the Citrix StoreFront console again
-
- Click on Manage Authentication Methods in the panel on the right side.
-
- Enable Pass-through from Citrix Gateway, if it is not enabled.
-
- Then click on the gear on Pass-through from Citrix Gateway and on Configure Delegated Authentication.
-
- In the following window, check the box next to Fully delegate credential validation to Citrix Gateway
-
- Click OK two times to close the windows.
-
- Click, back in the main window of the StoreFront console, on Manage Citrix Gateways.
In Manage Citrix Gateways, add a new gateway or edit an existing one to connect to the Citrix Gateway which will later be used as SP.
-
- In my case, I edited an existing Gaeway via Edit and configured the following under Authentication Settings:
-
- Version (10.0 (Build69.4) or later)
-
- VServer IP address (IP address of the Gateway VIP, e.g. 10.0.0.8)
-
- Logon type (Domain)
-
- Callback URL (Address of the Callback, e.g. https://citrix.deyda.net)
-
- In my case, I edited an existing Gaeway via Edit and configured the following under Authentication Settings:
-
- Confirm the settings with Finish.
Important here is that also in the internal DNS the callback address citrix.deyda.net is deposited.
-
- In the main menu of the StoreFront console, click on Configure Remote Access Settings
-
- Check that the item Allow users to access only resources delivered through StoreFront (No VPN tunnel) is activated.
Delivery Controller
The XML Trust must still be activated on the Delivery Controller if this is not already activated.
-
- To do this start a PowerShell as administrator on a Delivery Controller.
-
- Now run the following command.
asnp citrix.*
Set-BrokerSite -TrustRequestsSentToTheXmlServicePort $true
In the newer version of CVAD (>1906) a Citrix Cloud window follows after executing the PowerShell commands, for the Citrix Cloud credentials.
Microsoft Azure Multi-Factor-Authentication with Conditional Access
You can find more detailed background information on this topic here.
Conditional Access
-
- First, we sign up with an administrative account in Azure Portal (https://portal.azure.com)
-
- Click on Azure Active Directory > Security
-
- Click on Conditional Access
-
- Click on Named locations
-
- Click on New location
-
- Configure the following for the Azure Worker
-
- Name (e.g. Azure Worker)
-
- Define the location using (IP ranges)
-
- Mark as trusted location (Checked)
-
- IP ranges (IP range of the Worker, e.g. 10.0.0.1/24)
-
- Configure the following for the Azure Worker
-
- Click on Create
-
- Click under Policies on New policy
-
- In the new window, enter a Name for the policy (e.g. External MFA)
-
- Click on Users and groups
-
- Click under Include on All users
-
- Under Exclude click on Users and Groups
-
- Click on Select excluded users
-
- On the following window select the users that should not receive an MFA message, like the Break Glass User and the Sync Accounts
-
- Confirm with Done
-
- Click on Cloud apps or actions
-
- Click on Select apps and select the previously created Enterprise App (e.g. Citrix FAS)
-
- Confirm with Done
-
- Click on Conditions > Locations
-
- Click under Configure on Yes
-
- Click under Exclude on Selected locations
-
- Select the previously created Location (e.g. Azure Worker)
-
- Confirm with Done
-
- Click under Access controls on Grant
-
- Select Grant access and Require multi-factor authentication
-
- Confirm with Select
-
- Click under Enable policy on On
-
- Confirm with Create
Convert users from per-user MFA to Conditional Access based MFA
Before the following script works, a connection to Azure AD must be established. Execute the following lines.
# Install and Connect to Azure AD
Install-Module MSOnline
$Msolcred = Get-credential
Connect-MsolService -Credential $MsolCred
Save the following code into a PS1 file and execute it to swivel the MFA method.
# Sets the MFA requirement state
function Set-MfaState {
[CmdletBinding()]
param(
[Parameter(ValueFromPipelineByPropertyName=$True)]
$ObjectId,
[Parameter(ValueFromPipelineByPropertyName=$True)]
$UserPrincipalName,
[ValidateSet("Disabled","Enabled","Enforced")]
$State
)
Process {
Write-Verbose ("Setting MFA state for user '{0}' to '{1}'." -f $ObjectId, $State)
$Requirements = @()
if ($State -ne "Disabled") {
$Requirement =
[Microsoft.Online.Administration.StrongAuthenticationRequirement]::new()
$Requirement.RelyingParty = "*"
$Requirement.State = $State
$Requirements += $Requirement
}
Set-MsolUser -ObjectId $ObjectId -UserPrincipalName $UserPrincipalName `
-StrongAuthenticationRequirements $Requirements
}
}
# Disable MFA for all users
Get-MsolUser -All | Set-MfaState -State Disabled
List of configured MFA users
# Identify registered users
Get-MsolUser -All | where {$_.StrongAuthenticationMethods -ne $null} | Select-Object -Property UserPrincipalName | Sort-Object userprincipalname
List of unconfigured MFA users
# Identify non-registered users
Get-MsolUser -All | where {$_.StrongAuthenticationMethods.Count -eq 0} | Select-Object -Property UserPrincipalName | Sort-Object userprincipalname
Authentication App
We now log in to MFA Setup (https://aka.ms/mfasetup) with our test user to configure the Authentication App on the mobile device.
If the test user does not yet have a configured second factor, the following message appears. The configuration can be started with Next.
-
- In the next window, select the type of the Second Factor (e.g, Mobile App)
-
- To simplify the configuration, select to receive notifications for verification and click Next
-
- In the following window, a QR code is displayed, with which the Authentication App can be configured

-
- Open the Authenticator app on the device
-
- Click on the + symbol to add another account
-
- Select Business or School Account in the Accounts window
-
- Use the following menu item Scan QR Code to scan the existing QR Code
-
- Now the test user is displayed in the account list
-
- In the browser confirm the configuration of the MFA service with Next and Finish
Result
If we now open the FQDN of the gateway (https://citrix.deyda.net) via browser.
We will be forwarded directly to Azure-AD and can authenticate ourselves there.
We get our Citrix resources listed and can start them.

You can visit me on my website: https://www.deyda.net or follow me on twitter: Manuel Winkel.