I recently upgraded from CAS 5.1.6 to 5.2.0 and noticed that the theme parameter in my JSON service definitions is being treated as if it is a reference to a groovy script and not the name of the theme to load.
### -- Theme settings -- ###
cas.theme.paramName=theme
spring.thymeleaf.cache=false
spring.thymeleaf.prefix=classpath:/templates/
{
"@class" : "org.apereo.cas.services.RegexRegisteredService",
"name" : "Example",
"id" : 10000006,
"theme": "canvas",
"description" : "Example Service",
"evaluationOrder" : 1,
"usernameAttributeProvider" : {
"@class" : "org.apereo.cas.services.PrincipalAttributeRegisteredServiceUsernameProvider",
"usernameAttribute" : "sAMAccountName"
}
}
2017-12-10 04:54:39,434 DEBUG [org.apereo.cas.web.view.CasReloadableMessageBundle] - <Loading properties [messages.properties] with encoding 'UTF-8'>
2017-12-10 04:54:39,527 DEBUG [org.apereo.cas.services.web.ChainingThemeResolver] - <Attempting to resolve theme via [CookieThemeResolver]>
2017-12-10 04:54:39,527 DEBUG [org.apereo.cas.services.web.ChainingThemeResolver] - <Attempting to resolve theme via [SessionThemeResolver]>
2017-12-10 04:54:39,528 DEBUG [org.apereo.cas.services.web.ChainingThemeResolver] - <Attempting to resolve theme via [RequestHeaderThemeResolver]>
2017-12-10 04:54:39,528 DEBUG [org.apereo.cas.services.web.ChainingThemeResolver] - <Attempting to resolve theme via [ServiceThemeResolver]>
2017-12-10 04:54:39,529 DEBUG [org.apereo.cas.services.web.ServiceThemeResolver] - <Service [id=10000006,name=Example,description=Example Service,serviceId=^
https://example.highline.edu/.*,usernameAttributeProvider=usernameAttribute=sAMAccountName,<null>,theme=[canvas],evaluationOrder=1,logoutType=BACK_CHANNEL,attributeReleasePolicy=org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy@118e1bd0[attributeFilter=<null>,principalAttributesRepository=org.apereo.cas.authentication.principal.DefaultPrincipalAttributesRepository@581f099[],authorizedToReleaseCredentialPassword=false,authorizedToReleaseAuthenticationAttributes=true,authorizedToReleaseProxyGrantingTicket=false,excludeDefaultAttributes=false,principalIdAttribute=<null>,consentPolicy=org.apereo.cas.services.consent.DefaultRegisteredServiceConsentPolicy@1ad6e5d6[excludedAttributes=<null>,includeOnlyAttributes=<null>,enabled=true],allowedAttributes=[]],accessStrategy=org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy@7231b0de[enabled=true,ssoEnabled=true,requireAllAttributes=true,requiredAttributes={},unauthorizedRedirectUrl=<null>,caseInsensitive=false,rejectedAttributes={}],publicKey=<null>,proxyPolicy=org.apereo.cas.services.RefuseRegisteredServiceProxyPolicy@2eaa006d,logo=<null>,logoutUrl=<null>,requiredHandlers=[],properties={},multifactorPolicy=org.apereo.cas.services.DefaultRegisteredServiceMultifactorPolicy@130075d3[multifactorAuthenticationProviders=[],failureMode=NOT_SET,principalAttributeNameTrigger=<null>,principalAttributeValueToMatch=<null>,bypassEnabled=false],informationUrl=<null>,privacyUrl=<null>,contacts=[],expirationPolicy=org.apereo.cas.services.DefaultRegisteredServiceExpirationPolicy@198f4a12[deleteWhenExpired=false,notifyWhenDeleted=false,expirationDate=<null>],<null>] is configured to use a custom theme [[canvas]]>
2017-12-10 04:54:39,530 DEBUG [org.apereo.cas.services.web.ChainingThemeResolver] - <Attempting to resolve theme via [FixedThemeResolver]>
2017-12-10 04:54:39,530 DEBUG [org.apereo.cas.services.web.ChainingThemeResolver] - <No specific theme could be found. Using default theme [cas-theme-default}>
If I set the theme default via the cas.properties file to canvas, it loads the correct theme (of course I don't want that theme to be the default every where) and if I set the theme property in my json service definition to point to a groovy script that just returns "canvas", the correct theme is loaded.