Skip to end of metadata
Go to start of metadata
Table of Contents

New CAS documentation site

CAS documentation has moved over to, starting with CAS version 4.x. The wiki will no longer be maintained. For the most recent version of the documentation, please refer to the aforementioned link.

JAAS Authentication Handler

Briefly, JAAS is a standard API provided by Java 1.4 and higher which provides PAM-like authentication and authorization. An external file is used to configure JAAS. Using JAAS with CAS allows modification of the authentication process without having to rebuild and redeploy CAS, and allows for PAM-style multi-module "stacked" authentication.

Core Classes


The JaasAuthenticationHandler is a hook into the Java Authentication and Authorization Service and delegates all authentication to the underlying runtime and its configured JAAS file. Therefore it only has one property:

  • realm - the realm within the JAAS configuration file we are going to use. Defaults to CAS.


Like other handlers, the JAAS Authentication Handler is simply configured in the deployerConfigContext.xml. Within the AuthenticationManager's "authenticationHandlers" property, place the following configuration (replacing the example Test handler):

<bean class="" />

Example jaas.conf File

Below, you'll find an example jaas.conf file which would contain your JAAS configuration information.

The path to the JAAS Configuration file is specified for this JVM as a system property, i.e. , or a default can be specified for an entire Java Runtime Environment by changing the {jre-home}/lib/security/ properties file to add a "Default login configuration file" under the property "login.config.url.1=file:..." (find the comment example in the current file).

* Login Configuration for JAAS. First try Kerberos, then LDAP, then AD
* Note that a valid krb5.conf must be supplied to the JVM for Kerberos auth
CAS { sufficient
edu.uconn.netid.jaas.LDAPLoginModule sufficient
edu.uconn.netid.jaas.LDAPLoginModule sufficient

If you enable the Krb5LoginModule and authenticate the userid and password against a Kerberos KDC, then Java must be told the name of the Kerberos Realm and the network name of the KDC. Again, this can be done with system properties ( and or by copying a Unix krb5.conf file into the {jre-home}/lib/security directory. Note that SPNEGO also uses Kerberos and sets the same system properties. So if you are planning to use both JAAS and SPNEGO with Kerberos, read about SPNEGO configuration when planning JAAS.


If using jre 1.6, you will need to use " sufficient" for Kerberos V5 to work correctly.

  • No labels