NetScaler appliance as a SAML SP

The SAML Service Provider (SP) is a SAML entity that is deployed by the service provider. When a user tries to access a protected application, the SP evaluates the client request. If the client is unauthenticated (does not have a valid NSC_TMAA or NSC_TMAS cookie), the SP redirects the request to the SAML Identity Provider (IdP).

The SP also validates SAML assertions that are received from the IdP.

When the NetScaler appliance is configured as an SP, all user requests are received by a traffic management virtual server (load balancing or content switching) that is associated with the relevant SAML action.

The NetScaler appliance also supports POST and Redirect bindings during logout.


A NetScaler appliance can be used as a SAML SP in a deployment where the SAML IdP is configured either on the appliance or on any external SAML IdP.

When used as a SAML SP, a NetScaler appliance:

  • Can extract the user information (attributes) from the SAML token. This information can then be used in the policies that are configured on the NetScaler appliance. For example, if you want to extract the GroupMember and emailaddress attributes, in the SAMLAction, specify the Attribute2 parameter as GroupMember and the Attribute3 parameter as emailaddress.


    Default attributes such as username, password, and logout URL must not be extracted in attributes 1 to 16, because they as are implicitly parsed and stored in the session.

  • Can extract attribute names of upto 127 bytes from an incoming SAML assertion. The previous limit was 63 bytes. Support introduced in NetScaler 11.0 Build 64.x.

  • Supports post, redirect, and artifact bindings. Support for redirect and artifact bindings is introduced in NetScaler 11.0 Build 55.x.


     Redirect binding should not be used for large amount of data, when the assertion after inflate or decoding is greater than 10K.

  • Can decrypt assertions. Support introduced in NetScaler 11.0 Build 55.x.

  • Can extract multi-valued attributes from a SAML assertion. These attributes are sent is nested XML tags such as:

    <AttributeValue> <AttributeValue>Value1</AttributeValue> <AttributeValue>Value2</AttributeValue> </AttributeValue>

    When presented with above XML, the NetScaler appliance can extract both Value1 and Value2 as values of a given attribute, as opposed to the old firmware that extracts only Value1.


    Support introduced in NetScaler 11.0 Build 64.x.

  • Can specify the validity of a SAML assertion.

    If the system time on NetScaler appliance SAML IdP and the peer SAML SP is not in sync, the messages might get invalidated by either party. To avoid such cases, you can now configure the time duration for which the assertions will be valid.

    This duration, called the “skew time,” specifies the number of minutes for which the message should be accepted. The skew time can be configured on the SAML SP and the SAML IdP.


    Support introduced in NetScaler 11.0 Build 64.x.

  • Can send additional attribute called ‘ForceAuth’ in the authentication request to external IDP (Identity Provider). By default, the ForceAuthn is set to ‘False’. It can be set to ‘True’ to suggest IDP to force authentication despite existing authentication context. Additionally, NetScaler appliance SP does authentication request in query parameter when configured with artifact binding.

To configure the NetScaler appliance as a SAML SP by using the command line interface

  1. Configure a SAML SP action.


    The following command adds a SAML action that redirects unauthenticated user requests.

    add authentication samlAction SamlSPAct1 -samlIdPCertName nssp –samlRedirectUrl -relaystateRule "AAA.LOGIN.RELAYSTATE.EQ(\"\")"

    Points to note

    • Certificate provided for -samlIdPCertName in the samlAction command must match the corresponding certificate from IdP for the signature verification to succeed.
    • Citrix recommends to have a full domain name with trailing ‘/’ in the expression.
    • Administrators must configure an expression for relaysStateRule in the samlAction command. The expression must contain the list of published domains that the user connects to before being redirected to the authentication virtual server. For example, the expression must contain the domains of the front-end virtual server (VPN, LB, or CS) that use this SAML action for authentication.

    For more details on the command, see and

  2. Configure the SAML policy.


    The following command defines a SAML policy that applies the above defined SAML action to all traffic.

    add authentication samlPolicy SamlSPPol1 ns_true SamlSPAct1

  3. Bind the SAML policy to the authentication virtual server.


    The following command binds the SAML policy to a authentication virtual server named “av_saml”.

    bind authentication vserver av_saml -policy SamlSPPol1

  4. Bind the authentication virtual server to the appropriate traffic management virtual server.


    The following command adds a load balancing virtual server named “lb1_ssl” and associates the authentication virtual server named “av_saml” to the load balancing virtual server. add lb vserver lb1_ssl SSL 443 -persistenceType NONE -cltTimeout 180 -AuthenticationHost -Authentication ON -authnVsName av_saml

To configure a NetScaler appliance as a SAML SP by using the graphical user interface

  1. Configure the SAML action and policy.

    Navigate to Security > AAA - Application Traffic > Policies > Authentication > Advanced Policies > Policy, create a policy with SAML as the action type, and associate the required SAML action with the policy.

  2. Associate the SAML policy with an authentication virtual server.

    Navigate to Security > AAA - Application Traffic > Virtual Servers, and associate the SAML policy with the authentication virtual server.

  3. Associate the authentication server with the appropriate traffic management virtual server.

    Navigate to Traffic Management > Load Balancing (or Content Switching) > Virtual Servers, select the virtual server, and associate the authentication virtual server with it.

NetScaler appliance as a SAML SP