SAML2 Authentication
CAS can act as a SAML2 identity provider accepting authentication requests and producing SAML assertions.
If you intend to allow CAS to delegate authentication to an external SAML2 identity provider, you need to review this guide.
This document solely focuses on what one might do to turn on SAML2 support inside CAS. It is not to describe/explain the numerous characteristics of the SAML2 protocol itself. If you are unsure about the concepts referred to on this page, please start with reviewing the SAML2 Specification.
Federation Interop Evaluation
The CAS project strives to conform to the SAML V2.0 Implementation Profile for Federation Interoperability. An evaluation of the requirements against the current CAS release is available here. It is recommended that you view, evaluate and comment on functionality that is currently either absent or marked questionable where verification is needed.
SAML Endpoints
The following CAS endpoints respond to supported SAML2 profiles:
/idp/error
/idp/profile/SAML2/Redirect/SSO
/idp/profile/SAML2/POST/SSO
/idp/profile/SAML2/POST-SimpleSign/SSO
/idp/profile/SAML2/POST/SLO
/idp/profile/SAML2/Redirect/SLO
/idp/profile/SAML2/Unsolicited/SSO
/idp/profile/SAML2/SOAP/ECP
/idp/profile/SAML2/SOAP/AttributeQuery
/idp/profile/SAML1/SOAP/ArtifactResolution
Metadata Management
Handling and storing SAML2 identity provider or service provider metadata can be done in a few ways. To learn more, please review this guide.
Configuration
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-idp</artifactId>
<version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-saml-idp:${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-idp"
}
1
2
3
4
5
6
7
8
9
10
dependencies {
/*
The following platform references should be included automatically and are listed here for reference only.
implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
*/
implementation "org.apereo.cas:cas-server-support-saml-idp"
}
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/maven/releases/"
}
}
The following settings and properties are available from the CAS configuration catalog:
cas.authn.saml-idp.core.entity-id=https://cas.example.org/idp
The SAML entity id for the deployment. This setting supports the Spring Expression Language.
|
cas.authn.saml-idp.core.session-replication.replicate-sessions=true
Indicates whether profiles and other session data, collected as part of authentication flows and protocol requests that are kept by the container session, should be replicated across the cluster using CAS and its own ticket registry. Without this option, profile data and other related pieces of information should be manually replicated via means and libraries outside of CAS.
|
cas.authn.saml-idp.core.session-replication.cookie.allowed-ip-addresses-pattern=
A regular expression pattern that indicates the set of allowed IP addresses, when
|
cas.authn.saml-idp.core.session-replication.cookie.auto-configure-cookie-path=true
Decide if cookie paths should be automatically configured based on the application context path, when the cookie path is not configured.
|
cas.authn.saml-idp.core.session-replication.cookie.comment=CAS Cookie
CAS Cookie comment, describes the cookie's usage and purpose.
|
cas.authn.saml-idp.core.session-replication.cookie.domain=
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.
|
cas.authn.saml-idp.core.session-replication.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.
|
cas.authn.saml-idp.core.session-replication.cookie.max-age=-1
The maximum age of the cookie, specified in seconds. By default,
|
cas.authn.saml-idp.core.session-replication.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
|
cas.authn.saml-idp.core.session-replication.cookie.path=
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.
|
cas.authn.saml-idp.core.session-replication.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.
|
cas.authn.saml-idp.core.session-replication.cookie.same-site-policy=
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=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:
|
cas.authn.saml-idp.core.session-replication.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.
|