Acceptable Usage Policy
Also known as Terms of Use or EULA, CAS presents the ability to allow the user to accept the usage policy before moving on to the application. Production-level deployments of this feature would require modifications to the flow such that the retrieval and/or acceptance of the policy would be handled via an external storage mechanism such as LDAP or JDBC.
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-aup-webflow</artifactId>
<version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-aup-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-aup-webflow"
}
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-aup-webflow"
}
Customize the policy by modifying the casAcceptableUsagePolicyView.html
. See this guide to
learn more about user interface customizations. Note that the view here should have full access to the
resolved principal and attributes, if you wish to dynamically alter the page to present different text, etc.
Remember that acceptable usage policy executes after a successful authentication event where CAS has already established the authentication principal, since the policy record is strongly tied to the identified user record. Implementing this feature before the authentication event would require rather heavy modifications to the CAS webflow as well as alternative means of storing and remembering decisions such as cookies or browser storage, etc.
The following settings and properties are available from the CAS configuration catalog:
cas.acceptable-usage-policy.core.aup-attribute-name=aupAccepted
AUP attribute to choose in order to determine whether policy has been accepted or not. The attribute is expected to contain a boolean value where
|
cas.acceptable-usage-policy.core.enabled=true
Allows AUP to be turned off on startup.
|
cas.acceptable-usage-policy.core.aup-omit-if-attribute-missing=false
By default, the policy status is considered as denied when the attribute
|
cas.acceptable-usage-policy.core.aup-policy-terms-attribute-name=
AUP attribute to choose whose single value dictates how CAS should fetch the policy terms from the relevant message bundles.
|