Scenario
We came across a requirement while implementing Citrix Netscaler as a central authentication instance for web applications, which was described with several needs on the customer site.
- User are going to start a cloud web application for example from SAP or other cloud providers
- This application will create a SAML request and send it to a Netscaler AAA service to authenticate the users from an on-premise repository (LDAP)
- Netscaler will validate the request, based on the certificate and the existing sessions
- If there no active session the users must authenticate on the Netscaler before they can start the web application
- Netscaler authenticates the users on the central Active Directory
-
Users are separated in different Active Directory groups by roles.
- Users can have user rights
- Users can have administrative rights
- Users with administrative rights in the application must log in with a second factor, in our case RADIUS
- After a successful authentication, Netscaler will create a SAML assertion and redirect the user to the application
Authentication Flow
In the following article, I like to describe a authentication flow, which is simplified from the origin requirements, but still shows the need to distinguish different user groups before they have access to the application. The following diagram will show this flow.
I would like to recommend always to start which such a draft, so clarify the needs and the dependencies of the different components and the way we need to implement them.
Prerequisites
In my lab environment, I have the following components in place and working well:
- Application to create SAML request and process assertions
- Central Active Directory, with at least two different user groups for the application
- Second authentication instance, RADIUS
- Netscaler 11.1 50.10 Enterprise
Implementation
The following steps are in that order I found it’s the logical and easiest way to put the components together in the last steps:
Create Authentication Servers and Policies for the local site (LDAP, RADIUS)
1. LDAP Server and Policy for Group Extraction
As we could see in the flow chart we need the possibility to extract groups from LDAP to decide, if an user is a member of the admin groups or not. The way Netscaler will accomplish this to create a separate LDAP Server, which has authentication disabled.
2. LDAP for Authentication
Create a second LDAP server, where the checkbox for authentication is enabled. The rest of the settings can be the same. | |
Create Advanced LDAP Policy for Authentication |
3. RADIUS as second factor authentication
4. Create Advanced for decision if user needs a second factor or not
After the Group extraction step Netscaler needs to identify if an user is Admin or not. This can be done by extracting the „IS_MEMBER_OF“ attribute in the HTTP request.
Create Logon Schemas
Login Schema is an XML construct that is aimed at providing sufficient information to the Netscaler Logon mask so that it can generate individual screens for different use-cases Put another way, LoginSchema is a logical representation of logon form in XML medium.
1. Logon Schema to query the username
2. Logon Schema to query the LDAP password for standard user
For the authentication flow we need a logon schema, where the information of user name and LDAP password are needed. (Represented on the left side of the flow)
<ReadOnly>true</ReadOnly><InitialValue>${HTTP.REQ.USER.NAME.TYPECAST_LIST_T('@').GET(0).TO_LOWER}</InitialValue>
3. Logon Schema to query the LDAP and RADIUS password for admin user
4. Logon Schema for background tasks (noSchema)
The last logon schema is kind of dummy, we need if no other xml is need. Here you can use the „noschema“ template. |
|
For the described flow we need four schemas. |
Create Authentication Label
Authentication policy label is a collection of authentication policies for a particular factor, which also can have a „next factor“.
With nFactor, there is no single „secondary“ cascade. There could be „N“ secondary factors based on configuration. A label consists of at least a loginSchema and one authentication policy.
Create AAA vServer
To put the things together we need a AAA server.
Create IdP Profile and Policy
The last step is to create a SAML Policy, to have | |
The profile is a SAML IdP Profile to create an assertion, which can be customized to insert different attributes. |
Create a Session Policy with the home page with is the cloud web app
Demo Authenication
Logon with user privileges
Logon with admin privileges
When an admin user is inserted | |
The group extraction finds the user in the App-Admin group and will start the Two-Factor schema. | |
If the user has no rights, the following error is displayed.
Marco Klose works as a Technical Consultant, Architect and CTO focused on Application & Desktop virtualization as well as application delivery with the Citrix product portfolio. He is specialized in Citrix virtualization, Citrix networking and Microsoft products. He has +10 years experience and holds the latest Citrix certifications and is member of the Citrix Partner Expert Council EMEA (PTEC). Since 2021 he is also a Citrix Technology Advocate (CTA).