Citrix ADC as a SAML SP

The SAML service provider (SP) is a SAML entity 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 Citrix ADC appliance is configured as an SP, a traffic management virtual server (load balancing or content switching) receives all user requests associated with the relevant SAML action.

The Citrix ADC appliance also supports POST and Redirect bindings during logout.


A Citrix ADC 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 Citrix ADC 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 Citrix ADC 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–16, because they as are implicitly parsed and stored in the session.

  • Can extract attribute names of up to 127 bytes from an incoming SAML assertion. The previous limit was 63 bytes.

  • Supports post, redirect, and artifact bindings.


    Do not use redirect binding for large amounts of data when the assertion after inflate or decoding is greater than 10K.

  • Can decrypt assertions.

  • 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>


    From Citrix ADC 13.0 Build 63.x and above, the individual maximum length for SAML attributes has been increased to allow a maximum of 40k bytes. The size of all the attributes must not exceed 40k bytes.

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

  • Can specify the validity of a SAML assertion.

    If the system time on Citrix ADC 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 are valid.

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

  • Can send an extra attribute called ‘ForceAuth’ in the authentication request to an 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 the existing authentication context. Also, Citrix ADC SP sends an authentication request in the query parameter when configured with artifact binding.

To configure the Citrix ADC appliance as a SAML SP by using the CLI

  1. Configure a SAML SP action.


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

    add authentication samlAction SamlSPAct1 -metadataUrl "https://ksidp1.ksaaa.local/metadata/samlidp/SAML_IDP_profile" -samlIdPCertName nssp -samlSigningCertName 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.
    • SAML supports only the RSA certificate. Other certificates like HSM, FIPS are not supported.
    • It is recommended to have a full domain name with a 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.
    • If the authentication virtual server is configured as a SAML IdP, the metadata URL that must be used in the SAML SP action is https://<citrix-adc-saml-idp-fqdn>/metadata/samlidp/SAML_IDP_profile.


    If there are multiple SAML policies as part of an IdP chain, it is sufficient to configure a relay state rule only on the first SAML policy.

    For more details on the command, see and

  2. Configure the SAML policy.


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

    add authentication policy SamlSPPol1 -rule true -action SamlSPAct1

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


    The following command binds the SAML policy to an 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

    For more details on the command, see

To configure a Citrix ADC appliance as a SAML SP by using the GUI

  1. Navigate to Security>AAA-Policies>Authentication>Basic Policies>SAML.

  2. Select Servers tab, click Add, enter values for the following parameters, and click Create.

    Parameter descriptions:

    • Name - Name of the server

    • Redirect URL - URL that users authenticate against. Some IdP’s have special URLs that are not reachable unless under SAML setup.

    • Single Logout URL - URL specified so that the Citrix ADC can recognize when to send the client back to the IdP to complete the Sign out process. We will not use it in this simple deployment.

    • SAML Binding - A mechanism that is used to transport SAML requestor and responder messages between the SP and IdP. When Citrix ADC acts as an SP, it supports Post, Redirect, and Artifact bindings. The default binding method is POST.


      For Artifact binding, the transport mechanism on the SP and IdP must be the same.

    • Logout Binding - Specifies the transport mechanism of SAML logout messages. The default binding mechanism is Post.

    • IDP Certificate Name - IdPCert Certificate (Base64) present under SAML Signing Certificate.

    • User Field - Section of the IdP’s SAML authentication form that contains the username for the SP to extract if necessary.

    • Signing Certificate Name - Select the SAML SP certificate (with private key) that Citrix ADC uses to sign authentication requests to the IdP. The same certificate (without private key) must be imported to the IdP, so that the IdP can verify the authentication request signature. Most IdPs do not require the signing certificate name.

    • IssuerName - Identifier. Unique ID that is specified on both the SP and IdP to help identify the service provider to each other.

    • Reject unsigned assertion - Option that you can specify if you require the assertions from the IdP to be signed. The default option is ON.
      • ON: Rejects assertions without a signature
      • STRICT: Ensures that both response and assertion are signed
      • OFF: Allows unsigned assertions
    • Audience - Audience for which an assertion sent by IdP is applicable. This is typically an entity name or a URL that represents the service provider.

    • Signature Algorithm - Algorithm to be used to sign/verify SAML transactions. The default value is RSA-SHA256.

    • Digest Method - Algorithm to be used to compute/verify digest for SAML transactions. The default value is SHA256.

    • Default Authentication Group - The default group that is chosen when the authentication succeeds in addition to the extracted groups.

    • Group Name Field - Name of the tag in an assertion that contains user groups.

    • Skew Time (mins) - This option specifies the clock skew in minutes that the Citrix ADC service provider allows on an incoming assertion. For example, if you set the skew time to 10 minutes at 16:00, the SAML assertion is valid from 15:50 to 16:10 - 20 minutes in total. The default skew time is 5 minutes.
  3. Create a corresponding SAML policy.

    Navigate to Security > AAA-Application Traffic > Policies > Authentication > Advanced Policies > Policy and click Add.

    On the Create Authentication SAML Policy page, provide the following details:

    • Name - Specify a name for the SAML policy.
    • Action Type - Select SAML as the authentication action type.
    • Action - Select the SAML server profile to bind the SAML policy with.
    • Expression - Displays the name of the rule or expression that the SAML policy uses to determine if the user must authenticate with the SAML server. On the text box, set the value “rule = true” for the SAML policy to take effect and the corresponding SAML action to be run.
  4. Bind the SAML policy to the authentication virtual server.

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

  5. 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.

Citrix ADC as a SAML SP