Setting "cas.authn.pm.reset.mail.html=true" fails with error "elements... were left unbound"

428 views
Skip to first unread message

Abhinav Rau

unread,
Sep 3, 2019, 3:31:56 PM9/3/19
to CAS Community
For password rest functionality, I am trying to send a HTML formatted email. According to the documentation here and here, we need to set the "cas.authn.pm.reset.mail.html" property to true. When setting this property in application.properties, CAS fails to start with the error:

The elements [cas.authn.pm.reset.mail.html] were left unbound.
Action:
Update your application's configuration

I looked at the source code as well at EmailProperties.java and the property is there.

Any ideas?

Thanks!

Abhinav

Ray Bon

unread,
Sep 3, 2019, 5:06:18 PM9/3/19
to cas-...@apereo.org
Abhinav,

Have you enable password management in gradle.properties?

Ray
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.

Rob McKenzie

unread,
Sep 3, 2019, 10:26:24 PM9/3/19
to CAS Community

Hi all,

I am having the exact same issue. My instance is running CAS version 6.0.4 using the war overlay method, and I have even tried explicitly listing my module version using the syntax below.

compile "org.apereo.cas:cas-server-support-pm-webflow:6.0.4"

Is this the correct way to list the module version?


My compile command is:

./gradlew clean build --refresh-dependencies

...and just in case it helps, I have listed my entire build.gradle file contents below.

buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://repo.spring.io/libs-milestone" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "de.undercouch:gradle-download-task:${project.gradleDownloadTaskVersion}"
classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:${project.jibVersion}"
classpath "com.boazj.gradle:gradle-log-plugin:${project.gradleLogVersion}"
}
}

repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases/" }
maven { url "https://repo.spring.io/milestone/" }
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
}

def casServerVersion = project.'cas.version'
def casWebApplicationBinaryName = "cas.war"

project.ext."casServerVersion" = casServerVersion
project.ext."casWebApplicationBinaryName" = casWebApplicationBinaryName

apply from: rootProject.file("gradle/waroverlay.gradle")
apply from: rootProject.file("gradle/tasks.gradle")

apply plugin: "war"
apply plugin: "org.springframework.boot"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "com.google.cloud.tools.jib"

dependencies {
compile "org.apereo.cas:cas-server-webapp${project.appServer}:${casServerVersion}"
providedRuntime "org.glassfish.web:el-impl:2.2"
compile "org.apereo.cas:cas-server-support-ldap:${casServerVersion}"
compile "org.apereo.cas:cas-server-support-saml:${casServerVersion}"
compile "org.apereo.cas:cas-server-support-json-service-registry:${casServerVersion}"
compile "org.apereo.cas:cas-server-support-saml-idp:${casServerVersion}"
compile "org.apereo.cas:cas-server-support-oauth-webflow:${casServerVersion}"
compile "org.apereo.cas:cas-server-support-redis-ticket-registry:${casServerVersion}"
compile "org.apereo.cas:cas-server-support-pm:${casServerVersion}"
compile "org.apereo.cas:cas-server-support-pm-ldap:${casServerVersion}"
compile "org.apereo.cas:cas-server-support-pm-webflow:6.0.0"
// Other CAS dependencies/modules may be listed here...
}

tasks.findByName("jibDockerBuild")
.dependsOn(copyWebAppIntoJib, copyConfigIntoJib)
.finalizedBy(deleteWebAppFromJib)

configurations.all {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
cacheDynamicVersionsFor 0, "seconds"

preferProjectModules()

def failIfConflict = project.hasProperty("failOnVersionConflict") && Boolean.valueOf(project.getProperty("failOnVersionConflict"))
if (failIfConflict) {
failOnVersionConflict()
}
}
}

eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

war {
includeWarJars = true
entryCompression = ZipEntryCompression.STORED
rootSpec.exclude("**/javax.el-api*.jar")
}

springBoot {
mainClassName = "org.apereo.cas.web.CasWebApplication"
}

bootWar {
doFirst {
def executable = project.hasProperty("executable") && Boolean.valueOf(project.getProperty("executable"))
if (executable) {
logger.info "Including launch script for executable WAR artifact"
launchScript()
} else {
logger.info "WAR artifact is not marked as an executable"
}
archiveName "${casWebApplicationBinaryName}"
baseName "cas"
excludeDevtools = true
}
}

bootRun {
sourceResources sourceSets.main
classpath = sourceSets.main.runtimeClasspath
}

wrapper {
distributionType = Wrapper.DistributionType.BIN
gradleVersion = "${project.gradleVersion}"
}

jib {
from {
image = project.baseDockerImage
}
to {
image = "${project.group}/${project.name}"
/**
ecr-login: Amazon Elastic Container Registry (ECR)
gcr: Google Container Registry (GCR)
osxkeychain: Docker Hub
*/
credHelper = "osxkeychain"
/**
auth {
username = "*******"
password = "*******"
}
tags = [casServerVersion]
*/
}
container {
useCurrentTimestamp = true
entrypoint = ['docker/entrypoint.sh']
ports = ['80', '443', '8080', '8443']
labels = [version:casServerVersion, name:project.name, group:project.group]
}
extraDirectory {
path = file('src/main/jib')
permissions = [
'/docker/entrypoint.sh': '755'
]
}
}

bootJar {
rootSpec.exclude("**/javax.el-api*.jar")
}

jar {
rootSpec.exclude("**/javax.el-api*.jar")
}

bootWar {
rootSpec.exclude("**/javax.el-api*.jar")
}

Abhinav Rau

unread,
Sep 17, 2019, 10:36:32 AM9/17/19
to CAS Community
Fixed!

It looks like the property "cas.authn.pm.reset.mail.html" is only available in CAS version 6.1 which as of now is in RC stage. I was using 6.0 version. Just note that if you are using the WAR overlay then you will need to use the latest overlay (master branch as of now) which based on CAS 6.1.

Abhinav
Reply all
Reply to author
Forward
0 new messages