Nuxeo Server

CAS2 Authentication

Updated: March 18, 2024

This plugin implements a client for CAS SSO system (Central Authentication System).


It can be configured to use a CAS proxy. It has been tested and reported to work with CAS V2. It's easy to test this plugin by installing the JA-SIG Central Authentication Service Open Source CAS server.

To install the CAS2 authentication plugin:

  1. Make sure there is a CAS server already setup and running.
  2. Install the CAS2 Nuxeo Package.
  3. Put CAS2 plugin into the authentication chain. Contribute an XML extension from the following content. Adapt the authenticationChain element content with the list of plugins you want to use.


    Use CAS2_AUTH.

    In order to allow External Users into your system, make sure TOKEN_AUTH plugin is declared before CAS2_AUTH

  4. Create an XML extension called CAS2-config.xml with the following content:

    <component name="org.nuxeo.ecm.platform.authenticator.cas2.sso.config">
      <!-- Configure you CAS server parameters -->
      <extension target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService" point="authenticators">
        <authenticationPlugin name="CAS2_AUTH">
            <parameter name="ticketKey">ticket</parameter>
            <parameter name="appURL"></parameter>
            <parameter name="serviceLoginURL"></parameter>
            <parameter name="serviceValidateURL"></parameter>
            <parameter name="serviceKey">service</parameter>
            <parameter name="logoutURL"></parameter>
  5. Adapt the content of the loginModulePlugin section.

  6. Save.


A typical CAS use case would be the portal. In this n-tiers architecture, the identity is to be shared between the components.

The following diagram depicts the interactions between a client, a portal, a CAS server and Nuxeo for establishing the authentication context.

(a) Portal Service Ticket

The first phase is the portal authentication (a1).

GET /home

The client is redirected to the CAS server for entering its credentials (a2).

GET /cas/login?service=

Once the credentials are entered, if they are valid, the CAS server generates a service ticket ST. The client is redirected by the CAS server back onto the portal using the service URL (a3).

In the same time, the CAS server generates a ticket granting and registers it client side using the cookie CASTGC. If the cookie is already present in the request headers, then the client is automatically redirected to the portal.

(b) Proxy Granting Ticket

In the second phase, the portal validates the service ticket and requests for a proxy granting ticket PGT (b1).

GET /cas/serviceValidate?ticket=ST-81-rCbbm5oj9geCKjvhNCvJ-cas&

If the ticket is valid, the CAS server invokes the pgtUrl callback with two parameters pgtIou and pgtId (b2).

GET /ticket/accept?pgtIou=PGTIOU-34-jJZH23r2wbKUqbc3dLFt-cas&

In case of success, the server responds to the portal with the following content

<cas:serviceResponse xmlns:cas=''>

The pgtIou is used portal side for retrieving the accepted PGT.

(c) Nuxeo Proxy Ticket

In the third phase, the portal asks the CAS server for a new service ticket that will give him access to the Nuxeo server using the client identity (c1).

GET /cas/proxy?pgt=TGT-45-sSnfcQ7A0TXGsQR2gJONm74rObZ0qRQzhENJWTdZJG5rcGN2T5-cas&

The CAS server generates a new ST and responds to the portal with the following content:

<cas:serviceResponse xmlns:cas=''>

Then the proxy ticket is used by the portal for login into Nuxeo (c2).

GET /nuxeo/atom/cmis?ticket=ST-82-20eCHgCqvMCvnP6AmZmz-cas

The Nuxeo server validates the ticket by invoking the CAS server (c3).

GET /cas/proxyValidate?ticket=ST-82-20eCHgCqvMCvnP6AmZmz-cas&service=http:

If the ticket is valid, the CAS server sends the following response:

<cas:serviceResponse xmlns:cas=''>

The Nuxeo server creates an HTTP session and sends the AtomPub response message.

<?xml version='1.0' encoding='UTF-8'?>
<app:service xmlns:app=""

The portal saves the client context for being able to invoke Nuxeo using the same HTTP session.

(d) Invoking Nuxeo

The Nuxeo HTTP session id is retrieved from the portal session context and invoked.

GET /nuxeo/atom/cmis?repositoryId=default

CAS2 and Anonymous Authentication

CAS2 and anonymous authenticators have flows that can interfere with each others, creating some side effects like bad redirections.

To avoid that, the CAS2 plugin provides a replacement for the default Anonymous authenticator : basically this is a "CAS aware Anonymous authenticator". You can see a sample configuration available in:

But, basically, wanting to put together both CAS2 and Anonymous authentication means you have two types of users that will access Nuxeo. So, an alternate approach is to define two separated authentication chains, one for each type of user:

  • One chain for authenticated users: using CAS2 and some other authentication method you may need;
  • One chain for anonymous access.

In most of the case, each type of user will have access via a separated virtual host at reverse proxy level. You can use this so that:

  • At reverse proxy level you add a header for tagging the type of request; ex: Anonymous requests will have the header X-anonymous-access set to "on";
  • At Nuxeo level you configure the chains depending on the header;
    • Default / main chain is the one using CAS2;
    • You define specific chain for requests having the X-anonymous-access.

Sample XML contribution

<specificAuthenticationChain name="anonymous-access">
        <header name="X-anonymous-access">on</header>

You can see specificChains extension point for more info.