Use this guide to enable Multi-Factor Authentication access via SAML to Citrix NetScaler AGEE 11.0+

Citrix Desktop Receiver does not support SAML authentication and Citrix Mobile Receiver will support SAML authentication in Web Interface Setup only


1. Have Citrix NetScaler 11.0 or above with a valid license

2. Have NS platform license and separate AG license for Access Gateway (AG) functionality

Refer to detailed Citrix license information

3. Ensure that the Citrix NetScaler server has a valid identity certificate installed

An SSL Certificate can be purchased from SSL certificate providers (Entrust, VeriSign, GoDaddy, etc.)

4. Create a New Realm for the Citrix NetScaler AGEE integration in the SecureAuth IdP Web Admin

5. Configure the following tabs in the Web Admin before configuring the Post Authentication tab:

  • Overview – the description of the realm and SMTP connections must be defined
  • Data – an enterprise directory must be integrated with SecureAuth IdP
  • Workflow – the way in which users will access this application must be defined
  • Registration Methods / Multi-Factor Methods – the Multi-Factor Authentication methods that will be used to access this page (if any) must be defined

The Registration Methods tab in SecureAuth IdP Version 9.0 has been renamed Multi-Factor Methods as of Version 9.0.1

SecureAuth IdP Configuration Steps
Post Authentication


1. Select SAML 2.0 (SP Initiated by Post) Assertion Page from the Authenticated User Redirect dropdown in the Post Authentication tab in the Web Admin

2. An unalterable URL will be auto-populated in the Redirect To field, which will append to the domain name and realm number in the address bar (Authorized/SAML20SPInitPost.aspx)

3. A customized post authentication page can be uploaded, but it is not required

User ID Mapping


4. Select Authenticated User ID from the User ID Mapping

In typical scenarios, the Authenticated User ID is sent; however, if the Citrix NetScaler ID is contained in a different SecureAuth IdP Property, select that value from the dropdown

5. Select urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified from the Name ID Format dropdown (default)

Select a different option if Citrix requires it, which the Service Provider (SP) will provide

6. Select False from the Encode to Base64 dropdown

SAML Assertion / WS Federation


7. Set the WSFed/SAML Issuer to a Unique Name that will be shared with Citrix NetScaler

The WSFed/SAML Issuer must match exactly on the SecureAuth IdP side and the Citrix side

8. Provide the SP Start URL to enable SSO and to redirect users appropriately to access Citrix NetScaler AGEE

This would be the Citrix NetScaler VPN domain URL

9. Set the SAML Offset Minutes to make up for time differences between devices

10. Set the SAML Valid Hours to limit for how long the SAML assertion is valid

No configuration is required for the WSFed Reply To/SAML Target URL, SAML Consumer URL, SAML Recipient, or SAML Audience fields


11. Leave the Signing Cert Serial Number as the default value, unless there is a third-party certificate being used for the SAML assertion

If using a third-party certificate, click Select Certificate and choose the appropriate certificate

12. Download the Assertion Signing Certificate, export it as Base64, and store it on a local PC or Citrix NetScaler appliance to be used below

13. Provide the Domain in order to Download the Metadata File to send to Citrix (if required)

Click Save once the configurations have been completed and before leaving the Post Authentication page to avoid losing changes

Forms Auth / SSO Token


14. Click View and Configure FormsAuth keys / SSO token to configure the token/cookie settings and to configure this realm for SSO

These are optional configurations

 To configure this realm's token/cookie settings, follow these steps:
Forms Authentication


1. If SSL is required to view the token, select True from the Require SSL dropdown

2. Choose whether SecureAuth IdP will deliver the token in a cookie to the user's browser or device:

  • UseCookies enables SecureAuth IdP to always deliver a cookie
  • UseUri disables SecureAuth IdP to deliver a cookie, and instead deliver the token in a query string
  • AutoDetect enables SecureAuth IdP to deliver a cookie if the user's settings allow it
  • UseDeviceProfile enables SecureAuth IdP to deliver a cookie if the browser's settings allow it, no matter the user's settings

3. Set the Sliding Expiration to True if the cookie remains valid as long as the user is interacting with the page

4. Set the Timeout length to determine for how many minutes a cookie is valid

No configuration is required for the Name, Login URL, or Domain fields

Machine Key


5. No changes are required in the Validation field, unless the default value does not match the company's requirement

If a different value is required, select it from the dropdown

6. No changes are required in the Decryption field, unless the default value does not match the company's requirement

If a different value is required, select it from the dropdown

No configuration is required for the Validation Key or Decryption Key fields

Authentication Cookies


7. Enable the cookie to be Persistent by selecting True - Expires after Timeout from the dropdown

Selecting False - Session Cookie enables the cookie to be valid as long as the session is open, and will expire once the browser is closed or the session expires

No configuration is required for the Pre-Auth Cookie, Post-Auth Cookie, or the Clean Up Pre-Auth Cookie fields

Click Save once the configurations have been completed and before leaving the Forms Auth / SSO Token page to avoid losing changes

To configure this realm for SSO, refer to SecureAuth IdP Single Sign-on Configuration

To configure this realm for Windows Desktop SSO, refer to Windows desktop SSO configuration

Citrix NetScaler AGEE Configuration Steps


VPN Virtual Server is required for this integration

1. Log into the Citrix NetScaler AGEE admin console, and select Virtual Servers under NetScaler Gateway

2. Select the appropriate Virtual Server to use for this integration, or click Add to create a new one

See below for Virtual Server creation steps

 Create VPN Virtual Server
New VPN Virtual Server


1. Set a Name for the new Virtual Server

2. Provide the IPAddress

3. Provide the Port number

4. Click OK

SAML Authentication Policy


3. Open the Virtual Server, and click the + in the Authentication section to add the Authentication SAML Policy


4. Select SAML from the Choose Policy dropdown

5. Select Primary from the Choose Type dropdown

6. Click Continue


7. Click the + in the Select Policy section to create a new SAML policy

8. Once the policy and profile with certificate are created (steps 9-25 below), click Bind

Create Authentication SAML Policy


9. Provide a Name for the new SAML policy

10. Click the + in the Server section to create a new SAML profile

11. Select the newly created profile (steps 14-25 below) from the Server dropdown

12. Create an ns_true Expression

13. Click Create

Create Authentication SAML Server


14. Provide a Name for the new SAML profile

15. Click the + in the IDP Certificate Name section to add the SAML certificate

16. Select the Assertion Signing Certificate from the SecureAuth IdP Web Admin (step 12) and upload it onto Citrix

17. Set the Redirect URL to the Fully Qualified Domain Name (FQDN) of the SecureAuth IdP appliance, followed by the Citrix-integrated realm and /secureauth.aspx, e.g.

18. Set the Issuer Name to the same Unique Name established in the WSFed/SAML Issuer field in the SecureAuth IdP Web Admin (step 7)

19. Select ON from the Two Factor options

20. Select POST from the SAML Binding dropdown

21. Click Create

Troubleshooting / Common Issues


1. If an HTTP1.1 blank page appears on the Citrix NetScaler side after SecureAuth IdP authentication, then ensure that the date / time settings are correct on both sides

2. Check the NetScaler error counters from the NS console

Type shell and that will move to NSHostname (shell)#

Run the command, nsconmsg –d stats | grep –i saml_

From there, a screen (like the image) will show increased a SAML verification success message counter