CAS Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID cas-plugin Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
1.1.2 (archives)
Jun 02, 2014
Source Code
Issue Tracking
Pull Requests
Open Issues
Pull Requests
Fabien Crespel (id: fcrespel)
Usage Installations 2014-Aug 278
2014-Sep 281
2014-Oct 298
2014-Nov 283
2014-Dec 290
2015-Jan 313
2015-Feb 332
2015-Mar 354
2015-Apr 362
2015-May 349
2015-Jun 366
2015-Jul 338

This plugin enables use of Jasig CAS as an authentication source, for 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 and SAML 1.1)


Basic Setup

  1. Install the plugin from Manage Jenkins > Manage Plugins > Available > CAS Plugin
  2. Go to Manage Jenkins > Configure System > 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.
  4. Next to CAS Protocol, select the protocol to use to communicate with CAS, e.g. SAML 1.1 if you are using CAS 3.x or higher.
  5. Further down in the page, ensure the Jenkins URL is valid and can be reached by users, as it will be used by CAS to redirect back to Jenkins after authentication.
  6. 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:

  • Force Renewal: when checked, single sign-on is disabled: even if a CAS session is already open, the user will have to provide credentials again to confirm his identity.
  • Enable Single Sign-Out: when checked, single sign-out is enabled: whenever the user logs out of CAS (e.g. when logging out of another CAS-enabled application), the corresponding Jenkins session will be destroyed and the local user logged out as well. Note that for this to work, the CAS server must be able to communicate with Jenkins using the service URL that was passed to it during login.

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

  • CAS 1.0: a text-based legacy protocol. Custom extensions may provide support for roles, which can be parsed with a Groovy script specified in Roles Validation Script.
  • CAS 2.0: a XML-based protocol. It supports Proxy Tickets, allowing external applications already secured with CAS to authenticate in Jenkins without requiring user input or password. Custom extensions may provide support for attributes.
  • SAML 1.1: a XML-based protocol. It fully supports attributes out-of-the-box, without requiring custom extensions. This is the recommended protocol for CAS 3.x and higher.

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.


Access from external/scripted clients

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.

Instead, you should use the user's API token as the password; you can find it by going to the Configuration page of the Jenkins user you intend to use for external access. This API token does not expire and you may regenerate it as you need.

See the following page for more information: Authenticating scripted clients


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

Using normal username/password is not possible from external/scripted clients when using CAS.
See "Usage" section above for a solution.

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.


Version 1.1.2

  • Better handling of multi-valued attributes during Jenkins user creation/update (thanks to Maxime Besson).
  • Changed 'Try again' link in failed login page to be relative instead of absolute (fixes issue when Jenkins is run from sub-uri).

Version 1.1.1

  • Redirect to origin URL after authentication (instead of always showing Jenkins home page).
  • Show custom error page with proper "Try again" link in case of login failure (e.g. due to an invalid ticket).
  • Removed unused AspectJ JARs, reducing the overall plugin size (thanks to Jozef Kotlar).

Version 1.1.0

  • Support for CAS 2.0 Proxy Tickets, allowing external applications already secured with CAS to authenticate in Jenkins without requiring user input or password.

Version 1.0.0

  • Initial release of the new CAS Plugin
  • Multiple protocols support: CAS 1.0, CAS 2.0, SAML 1.1
  • Custom CAS 1.0 response parsing support
  • CAS 2.0 and SAML 1.1 attributes support
  • Single Sign-Out support
  • Jenkins API Token support (no conflict)


plugin-user plugin-user Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment