{jenkins-plugin-info:pluginId=cas-plugin}

This plugin enables use of CAS (Central Authentication Service) as an authentication source for Jenkins, with single sign-on and single sign-out support.

This plugin is meant to replace the CAS1 Plugin by providing new features along existing ones, while adding support for more protocols (e.g. CAS 2.0/3.0 and SAML 1.1)

Setup

Basic Setup

  1. Install the plugin from Manage Jenkins > Manage Plugins > Available > CAS Plugin.
  2. Go to Manage Jenkins > Configure Global Security, check Enable Security and select CAS (Central Authentication Service) as the Security Realm.
  3. Next to CAS Server URL, enter the base URL to your CAS server, e.g. https://cas.example.com/cas
  4. Next to CAS Protocol, select the protocol to use to communicate with CAS, e.g. SAML 1.1 if you are using Apereo CAS Server 3.x or higher, or CAS 3.0 if you are using Apereo CAS Server 4.x or higher.
  5. If there are no warnings, click the Save button at the bottom and attempt logging in.

Advanced Setup

Additional configuration options are available under the Security Realm section:

Several protocols implemented by CAS are available in the CAS Protocol dropdown (click the Advanced... button to reveal more options):

Attributes are an easy (and recommended) way to add full name and email address information to an authenticated user, as well as roles/groups membership. CAS 1.0 response parsing with a custom Groovy script is made available as a legacy option for backward compatibility with the CAS1 Plugin.

Usage

Access from external/scripted clients

By default, when using the CAS plugin for authentication, you cannot use a regular username/password for remote authentication into Jenkins. This is by design, as the CAS protocol does not allow "direct" authentication and works with secure redirections, which are not compatible with remote calls such as SVN or GitHub hooks.

You have two options:

See the following page for more information: Authenticating scripted clients

Jenkins URL when used behind a reverse proxy

When using Jenkins behind a reverse proxy, depending on configuration the URL users get redirected to after authentication may be wrong. If this is the case:

  1. Go to Manage Jenkins > Configure System.
  2. Under Jenkins Location, make sure the Jenkins URL is valid and can be reached by users. It will be used by CAS to redirect back to Jenkins after authentication.

Troubleshooting

SSL certificate issues

Please see the SSL Troubleshooting and Reference Guide from the CAS Project.

Issue validating SAML 1.1 tickets

If Jenkins systematically fails to validate SAML 1.1 tickets, make sure to check whether the system clock of your Jenkins and CAS servers are synchronized.
Indeed, the timestamp at which SAML 1.1 tickets were generated is checked when validating them, with a configurable tolerance (see "Time Tolerance" plugin option).
Out-of-sync clocks may log errors such as "skipping assertion that's not yet valid" in Jenkins.

Failure to authenticate external/scripted clients

By default, using normal username/password is not possible from external/scripted clients when using CAS.
You may use an API token instead and/or enable the REST API support. See "Usage" section above for more details.

Missing group memberships when logging with external/scripted clients

This issue (JENKINS-20064) is fixed in Jenkins 1.556 and higher, provided that the user logged in through the web interface at least once.
This limitation does not apply when the REST API option is enabled along with the real username/password.

Invalid Jenkins URL after logging in through CAS

If Jenkins is behind a reverse proxy, it may not be able to detect its own URL by itself. In this case, you need to manually configure the Jenkins URL.
See "Usage" section above for a solution.

Changelog

Version 1.4.3 (2019-01-21)

Version 1.4.2 (2018-06-04)

Version 1.4.1 (2017-10-01)

Version 1.4.0 (2017-05-09)

Version 1.3.0 (2016-10-19)

Version 1.2.0 (2015-09-13)

Version 1.1.2 (2014-06-02)

Version 1.1.1 (2012-11-10)

Version 1.1.0 (2012-09-07)

Version 1.0.0 (2012-09-05)