Overview

Google Apps for Education (or any of the Google Apps) utilizes SAML 2.0 to provide an integration point for external authentication services.

Usage

The Google Apps for Education integration described here allows CAS to act as a miniaturized SAML2 identity provider, for deployments that may not be prepared to turn on and allow CAS to fully act as a SAML2 identity provider. This feature is deprecated and is scheduled to be removed in the future. It does not make much sense to maintain and use both features in CAS at the same time, as one outranks the other and it is likely that using both features in CAS simultaneously would interfere with the functionality of both. If you can, consider using the SAML2 identity provider functionality in CAS to handle this integration as you would any other SAML2 service provider.

Support is enabled by including the following dependency in the WAR overlay:

1
2
3
4
5
<dependency>
  <groupId>org.apereo.cas</groupId>
  <artifactId>cas-server-support-saml-googleapps</artifactId>
  <version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-saml-googleapps:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
  imports {
    mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
  }
}

dependencies {  
  implementation "org.apereo.cas:cas-server-support-saml-googleapps"
}

Generate Public/Private Keys

The first step is to generate DSA/RSA public and private keys. These are used to sign and read the Assertions. After keys are created, the public key needs to be registered with Google.

The keys will also need to be available to the CAS application (but not publicly available over the Internet) via the classpath though any location accessible by the user running the web server instance and not served publicly to the Internet is acceptable. Thus, inside src/main/resources is nice because it is scoped to the web application but not normally served. /etc/cas/ is also fine as well and protects the key from being overwritten on deploy of a new CAS webapp version.

1
2
3
4
openssl genrsa -out private.key 1024
openssl rsa -pubout -in private.key -out public.key -inform PEM -outform DER
openssl pkcs8 -topk8 -inform PER -outform DER -nocrypt -in private.key -out private.p8
openssl req -new -x509 -key private.key -out x509.pem -days 365

The x509.pem file should be uploaded into Google Apps under Security/SSO.

The following settings and properties are available from the CAS configuration catalog:

The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.

  • cas.google-apps.private-key-location=file:/etc/cas/private.key
  • The private key location that is used to sign responses, etc. Deprecation: Since 6.2

    org.apereo.cas.configuration.model.support.saml.googleapps.GoogleAppsProperties.

    Deprecation status is ERROR without a replacement setting.

  • cas.google-apps.public-key-location=file:/etc/cas/public.key
  • The public key location that is also shared with google apps. Deprecation: Since 6.2

    org.apereo.cas.configuration.model.support.saml.googleapps.GoogleAppsProperties.

    Deprecation status is ERROR without a replacement setting.

    The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value. You should only include this field in your configuration if you need to modify the default value.

  • cas.google-apps.key-algorithm=RSA
  • Signature algorithm used to generate keys. Deprecation: Since 6.2

    org.apereo.cas.configuration.model.support.saml.googleapps.GoogleAppsProperties.

    Deprecation status is ERROR without a replacement setting.