Overview

The integration between the CAS Server and ADFS delegates user authentication from CAS Server to ADFS, making CAS Server a WS-Federation client. Claims released from ADFS are made available as attributes to CAS Server, and by extension CAS Clients.

Remember

The functionality described here allows CAS to use ADFS as an external identity provider. If you wish to do the opposite, allowing ADFS to become a CAS client and using CAS as an identity provider, you may take advantage of SAML2 support in CAS as one integration option.

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-wsfederation-webflow</artifactId>
  <version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-wsfederation-webflow:${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-wsfederation-webflow"
}

You may also need to declare the following repository in your CAS Overlay to be able to resolve dependencies:

1
2
3
4
5
6
repositories {
    maven { 
        mavenContent { releasesOnly() }
        url "https://build.shibboleth.net/nexus/content/repositories/releases" 
    }
}
JCE Requirement

It's safe to make sure you have the proper JCE bundle installed in your Java environment that is used by CAS, specially if you need to consume encrypted payloads issued by ADFS. Be sure to pick the right version of the JCE for your Java version. Java versions can be detected via the java -version command.

WsFed Configuration

Adjust and provide settings for the ADFS instance, and make sure you have obtained the ADFS signing certificate and made it available to CAS at a location that can be resolved at runtime.

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.authn.wsfed-idp.sts.realm.issuer=CAS
  • Issuer/name of the realm identified and registered with STS.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceRealmProperties.

  • cas.authn.wsfed-idp.sts.realm.key-password=
  • Key alias associated with the this realm.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceRealmProperties.

  • cas.authn.wsfed-idp.sts.realm.keystore-file=
  • Keystore path associated with the this realm.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceRealmProperties.

  • cas.authn.wsfed-idp.sts.realm.keystore-password=
  • Keystore password associated with the this realm.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceRealmProperties.

  • cas.authn.wsfed-idp.idp.realm=urn:org:apereo:cas:ws:idp:realm-CAS
  • At this point, by default security token service’s endpoint operate using a single realm configuration and identity provider configuration is only able to recognize and request tokens for a single realm. Registration of clients need to ensure this value is matched.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationIdentityProviderProperties.

  • cas.authn.wsfed-idp.idp.realm-name=CAS
  • Realm name.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationIdentityProviderProperties.

  • cas.authn.wsfed[0].id=
  • Internal identifier for this wsfed configuration. If undefined, the identifier would be auto-generated by CAS itself. In the event that there is more than on CAS server defined in a clustered deployment, this identifier must be statically defined in the configuration.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].identity-attribute=upn
  • The attribute extracted from the assertion and used to construct the CAS principal id.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].identity-provider-identifier=http://adfs.example.org/adfs/services/trust
  • The entity id or the identifier of the Wsfed instance.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].identity-provider-url=https://adfs.example.org/adfs/ls/
  • Wsfed identity provider url.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].relying-party-identifier=urn:cas:localhost
  • The identifier for CAS (RP) registered with wsfed.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].signing-certificate-resources=classpath:adfs-signing.crt
  • Locations of signing certificates used to verify assertions.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed-idp.sts.crypto.encryption.key=
  • The encryption key is a JWT whose length is defined by the encryption key size setting.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtCryptoProperties.

  • cas.authn.wsfed-idp.sts.crypto.signing.key=
  • The signing key is a JWT whose length is defined by the signing key size setting.

    org.apereo.cas.configuration.model.core.util.SigningJwtCryptoProperties.

  • cas.authn.wsfed[0].attribute-mutator-script.location=
  • The location of the resource. Resources can be URLS, or files found either on the classpath or outside somewhere in the file system.

    org.apereo.cas.configuration.model.SpringResourceProperties.

  • cas.authn.wsfed[0].cookie.crypto.encryption.key=EMPTY
  • The encryption key is a JWT whose length is defined by the encryption key size setting.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtCryptoProperties.

  • cas.authn.wsfed[0].cookie.crypto.signing.key=EMPTY
  • The signing key is a JWT whose length is defined by the signing key size setting.

    org.apereo.cas.configuration.model.core.util.SigningJwtCryptoProperties.

    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.

  • cas.authn.wsfed-idp.sts.conditions-accept-client-lifetime=true
  • Set whether client lifetime is accepted.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.conditions-fail-lifetime-exceedance=false
  • If requested lifetime exceeds shall it fail (default) or overwrite with maximum lifetime.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.conditions-future-time-to-live=PT60S
  • Get how long (in seconds) a client-supplied Created Element is allowed to be in the future. The default is 60 seconds to avoid common problems relating to clock skew.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.conditions-lifetime=PT30M
  • Set the default lifetime in seconds for issued SAML tokens.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.conditions-max-lifetime=PT12H
  • Set the maximum lifetime in seconds for issued SAML tokens.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.custom-claims=
  • Collection of fully-qualified claims prefixed with the appropriate namespace that are expected to be released via attribute release policy.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.encrypt-tokens=true
  • Whether tokens generated by STS should encrypted.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.encryption-keystore-file=
  • Keystore path used to encrypt tokens.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.encryption-keystore-password=
  • Keystore password used to encrypt tokens.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.realm.keystore-alias=
  • Key alias associated with the this realm.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceRealmProperties.

  • cas.authn.wsfed-idp.sts.sign-tokens=true
  • Set whether the provided token will be signed or not. Default is true.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.signing-keystore-file=
  • Keystore path used to sign tokens.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.signing-keystore-password=
  • Keystore password used to sign tokens.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.subject-name-id-format=unspecified
  • When generating a SAML token, indicates the subject name-id format to use. Accepted values are:

    • unspecified
    • email
    • transient
    • persistent
    • entity

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed-idp.sts.subject-name-qualifier=http://cxf.apache.org/sts
  • When generating a SAML token, indicates the subject name-id qualifier to use.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationSecurityTokenServiceProperties.

  • cas.authn.wsfed[0].attribute-resolver-enabled=true
  • Whether CAS should enable its own attribute resolution machinery after having received a response from wsfed.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].attributes-type=WSFED
  • Indicates how attributes should be recorded into the principal object. Useful if you wish to additionally resolve attributes on top of what wsfed provides. Accepted values are CAS,WSFED,BOTH.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].auto-redirect=true
  • Whether CAS should auto redirect to this wsfed instance.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].cookie.allowed-ip-addresses-pattern=
  • A regular expression pattern that indicates the set of allowed IP addresses, when #isPinToSession() is cofigured. In the event that there is a mismatch between the cookie IP address and the current request-provided IP address (i.e. network switches, VPN, etc), the cookie can still be considered valid if the new IP address matches the pattern specified here.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.comment=CAS Cookie
  • CAS Cookie comment, describes the cookie's usage and purpose.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.domain=EMPTY
  • Cookie domain. Specifies the domain within which this cookie should be presented. The form of the domain name is specified by RFC 2965. A domain name begins with a dot (.foo.com) and means that the cookie is visible to servers in a specified Domain Name System (DNS) zone (for example, www.foo.com, but not a.b.foo.com). By default, cookies are only returned to the server that sent them.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.http-only=true
  • true if this cookie contains the HttpOnly attribute. This means that the cookie should not be accessible to scripting engines, like javascript.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.max-age=
  • The maximum age of the cookie, specified in seconds. By default, -1 indicating the cookie will persist until browser shutdown. A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age. A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.name=
  • Cookie name. Constructs a cookie with a specified name and value. The name must conform to RFC 2965. That means it can contain only ASCII alphanumeric characters and cannot contain commas, semicolons, or white space or begin with a $ character. The cookie's name cannot be changed after creation. By default, cookies are created according to the RFC 2965 cookie specification. Cookie names are automatically calculated assigned by CAS at runtime, and there is usually no need to customize the name or assign it a different value unless a special use case warrants the change.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.path=EMPTY
  • Cookie path. Specifies a path for the cookie to which the client should return the cookie. The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. A cookie's path must include the servlet that set the cookie, for example, /catalog, which makes the cookie visible to all directories on the server under /catalog. Consult RFC 2965 (available on the Internet) for more information on setting path names for cookies.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.pin-to-session=true
  • When generating cookie values, determine whether the value should be compounded and signed with the properties of the current session, such as IP address, user-agent, etc.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.same-site-policy=EMPTY
  • If a cookie is only intended to be accessed in a first party context, the developer has the option to apply one of settings SameSite=Lax or SameSite=Strict or SameSite=None to prevent external access.

    To safeguard more websites and their users, the new secure-by-default model assumes all cookies should be protected from external access unless otherwise specified. Developers must use a new cookie setting, SameSite=None, to designate cookies for cross-site access. When the SameSite=None attribute is present, an additional Secure attribute is used so cross-site cookies can only be accessed over HTTPS connections.

    Accepted values are: Lax, Strict, None.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].cookie.secure=true
  • True if sending this cookie should be restricted to a secure protocol, or false if the it can be sent using any protocol.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties.

  • cas.authn.wsfed[0].encryption-certificate=classpath:certificate.crt
  • The path to the public key/certificate used to handle and verify encrypted assertions.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].encryption-private-key=classpath:private.key
  • The path to the private key used to handle and verify encrypted assertions.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].encryption-private-key-password=NONE
  • The private key password.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].name=
  • Name of the authentication handler.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].order=MAX_VALUE
  • The order of the authentication handler in the chain.

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed[0].tolerance=PT10S
  • Tolerance value used to skew assertions to support clock drift.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties.

  • cas.authn.wsfed-idp.sts.crypto.alg=
  • The signing/encryption algorithm to use.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties.

  • cas.authn.wsfed-idp.sts.crypto.enabled=true
  • Whether crypto operations are enabled.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties.

  • cas.authn.wsfed-idp.sts.crypto.encryption.key-size=512
  • The encryption key size.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtCryptoProperties.

  • cas.authn.wsfed-idp.sts.crypto.signing.key-size=512
  • The signing key size.

    org.apereo.cas.configuration.model.core.util.SigningJwtCryptoProperties.

  • cas.authn.wsfed-idp.sts.crypto.strategy-type=ENCRYPT_AND_SIGN
  • Control the cipher sequence of operations. The accepted values are:

    • ENCRYPT_AND_SIGN: Encrypt the value first, and then sign.
    • SIGN_AND_ENCRYPT: Sign the value first, and then encrypt.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties.

  • cas.authn.wsfed[0].cookie.crypto.alg=DEFAULT_CONTENT_ENCRYPTION_ALGORITHM
  • The signing/encryption algorithm to use.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties.

  • cas.authn.wsfed[0].cookie.crypto.enabled=true
  • Whether crypto operations are enabled.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties.

  • cas.authn.wsfed[0].cookie.crypto.encryption.key-size=512
  • The encryption key size.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtCryptoProperties.

  • cas.authn.wsfed[0].cookie.crypto.signing.key-size=512
  • The signing key size.

    org.apereo.cas.configuration.model.core.util.SigningJwtCryptoProperties.

  • cas.authn.wsfed[0].cookie.crypto.strategy-type=ENCRYPT_AND_SIGN
  • Control the cipher sequence of operations. The accepted values are:

    • ENCRYPT_AND_SIGN: Encrypt the value first, and then sign.
    • SIGN_AND_ENCRYPT: Sign the value first, and then encrypt.

    org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties.