Applying Custom Theme CAS 5.3.x

1,009 views
Skip to first unread message

Fahmi L. Ramdhani

unread,
Sep 26, 2018, 4:43:17 PM9/26/18
to CAS Community
Hi,

I tried to customize the display based on the guidelines from https://apereo.github.io/cas/5.3.x/installation/Configuration-Properties.html#views with the theme "skeleton" name stored in:

(workspace) /opt/cas/workspace/cas-overlay-template
etc
/cas/config/skeleton_in_ID.properties -> Copy files from messages.properties but still error.
etc
/cas/config/skeleton.properties -> cas.standard.css.file=/themes/skeleton/css/cas.css ... etc

directory structures:
etc/cas/templates/skeleton/casViewLogin.html ... etc
etc
/cas/static/themes/skeleton/css
etc/cas/static/themes/skeleton/js



But after rebuilding and try new theme, there is an error message:
2018-09-26 20:33:29,502 WARN [org.springframework.context.support.ResourceBundleMessageSource] - <ResourceBundle [skeleton] not found for MessageSource: Can't find bundle for base name skeleton, locale in_ID>
2018-09-26 20:33:29,848 WARN [org.springframework.context.support.ResourceBundleMessageSource] - <ResourceBundle [skeleton] not found for MessageSource: Can'
t find bundle for base name skeleton, locale in_ID>

Can some one help me on this issue? Thanks.

Fahmi L. Ramdhani

unread,
Sep 26, 2018, 4:46:54 PM9/26/18
to CAS Community
In etc/cas/config/cas.properties:

cas.theme.paramName: theme
cas
.theme.defaultThemeName: skeleton

spring
.thymeleaf.cache=false
cas
.view.templatePrefixes[0]: file:///etc/cas/templates

cas
.messageBundle.baseNames=classpath:/skeleton_in_ID.properties,classpath:messages

Help me on this issue. Thanks.

Andy Ng

unread,
Sep 27, 2018, 4:15:16 AM9/27/18
to CAS Community
Hi,

it is a bit hard to look through your directory structure, so I can't really comment on that now.

However, there are examples out there with successful custom theme implementation, maybe those will help you understand the directory better:

Cheers!
- Andy

Fahmi L. Ramdhani

unread,
Sep 27, 2018, 5:16:19 AM9/27/18
to CAS Community
This customization is based on the link https://groups.google.com/a/apereo.org/forum/#!searchin/cas-user/themes/cas-user/k-yfoou7Zy0/BXry1PxgFAAJ. The directory structure is the same as the example you provided. But after rebuilding and try new theme, there is an error message:

2018-09-26 20:33:29,502 WARN [org.springframework.context.support.ResourceBundleMessageSource] - <ResourceBundle [skeleton] not found forMessageSource: Can't find bundle for base name skeleton, locale in_ID>

2018-09-26 20:33:29,848 WARN [org.springframework.context.support.ResourceBundleMessageSource] - <ResourceBundle [skeleton] not found for MessageSource: Can'
t find bundle for base name skeleton, locale in_ID>

Can you help provide a solution to this problem? Thanks.

Andy Ng

unread,
Sep 27, 2018, 10:27:52 PM9/27/18
to CAS Community
Hi Fahmi,

Sorry I am not able to provide a solution to your problem. Mainly because there are not enough information provided. 

I can say for sure that 5.3.x custom theme do works (I am using 5.3.3 myself), so most likely it is not because of version problem, but is actually something in your own customization / config that is incorrect.

Maybe other can provide a solution for you?

- Andy


Doug Campbell

unread,
Sep 28, 2018, 1:11:53 AM9/28/18
to cas-...@apereo.org

Fahmi,

 

My guess is that you have not put the skelton_in_ID.properties file in the correct location.  I believe it should be in the src/main/resources folder.  Also, the setting you have for cas.messageBundle.baseNames doesn’t look right to me.

 

The default setting is:  classpath:custom_messages,classpath:messages

 

So, I would think you might want:

 

cas.messageBundle.baseNames=classpath:skelton,classpath:messages

 

Assuming you place the skelton_in_ID.properties file in src/main/resources/ and you change the setting for cas.messageBundle.baseNames I think it should work for you.

 

Doug

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/0270214f-2290-49a3-a203-d69cc9afbdbd%40apereo.org.

Fahmi L. Ramdhani

unread,
Sep 28, 2018, 10:42:10 AM9/28/18
to CAS Community
Thanks Doug and all. My files and directories structure is:

/opt/workspace/cas-overlay
  • build.cmd
  • build.sh 
  • [etc] 
    • [cas]
      • [config]
        • cas.properties
        • log42j.xml
        • skeleton_in_ID.properties
        • skeleton.properties
      • [services]
        • HttpsAndImapsWildcard-xxxxxxxxx.json
      • [static]
        • [themes]
          • [skeleton]
            • [css]
            • [js]
      • [templates]
        • [skeleton]
          • casLoginView.html
  • LICENSE.txt 
  • [maven] 
  • mvnw 
  • mvnw.bat 
  • pom.xml
  • README.md 
  • [target]
Based on the structure above, where is src/main/resources/ located? and bellow my cas.properties configuration:
cas.server.name: https://login.domain.com:8443
cas
.server.prefix: ${cas.server.name}/cas

cas
.adminPagesSecurity.ip=127\.0\.0\.1

cas
.tgc.secure: true
cas
.tgc.crypto.signing.key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
cas
.tgc.crypto.encryption.key: xxxxxxxxxxxxxxxxxxxx

cas
.webflow.crypto.signing.key: xxxxxxxxxxxxxxxxxx
cas
.webflow.crypto.encryption.key: xxxxxxxxxxxxxx==

cas
.serviceRegistry.json.location: file:/etc/cas/services

cas
.theme.paramName: theme
cas
.theme.defaultThemeName: skeleton

spring
.thymeleaf.cache: false
cas
.view.templatePrefixes[0]: file:///etc/cas/templates

cas
.messageBundle.baseNames: classpath:skeleton,classpath:messages

logging
.config: file:/etc/cas/config/log4j2.xml

Please provide me solution. Thank you all.

David Curry

unread,
Sep 28, 2018, 11:18:18 AM9/28/18
to cas-...@apereo.org
The static/themes/skeleton and templates/skeleton subdirectories do not belong in etc/cas/config; they belong in src/main/resources in your overlay so that they get bundled into cas.war.

Like this:

/opt/workspace/cas-overlay-template/
├── LICENSE.txt
├── README.md
├── build.cmd
├── build.sh*
├── etc/
│   └── cas/
│       ├── config/
│       │   ├── admusers.properties
│       │   ├── application.yml
│       │   ├── cas.properties
│       │   └── log4j2.xml
│       ├── google/
│       │   ├── privatekey.der
│       │   ├── privatekey.pem
│       │   ├── publickey.der
│       │   └── x509.pem
│       ├── saml/
│       │   ├── idp-encryption.crt
│       │   ├── idp-encryption.key
│       │   ├── idp-metadata.xml
│       │   ├── idp-signing.crt
│       │   └── idp-signing.key
│       └── services/
├── maven/
├── mvnw*
├── mvnw.bat*
├── pom.xml*
├── src/
│   └── main/
│       └── resources/
│           ├── custom_messages.properties
│           ├── newschool.properties
│           ├── static/
│           │   └── themes/
│           │       └── newschool/
│           │           ├── css/
│           │           │   ├── admin.css
│           │           │   ├── bootstrap-material-design.min.css
│           │           │   ├── newschool.css
│           │           │   └── ripples.min.css
│           │           ├── fonts/
│           │           │   └── Neue/
│           │           │       ├── Neue-Black.eot
│           │           │       ├── Neue-Black.svg
│           │           │       ├── Neue-Black.ttf
│           │           │       ├── Neue-Black.woff
│           │           │       ├── Neue-Bold.eot
│           │           │       ├── Neue-Bold.svg
│           │           │       ├── Neue-Bold.ttf
│           │           │       ├── Neue-Bold.woff
│           │           │       ├── Neue-BoldItalic.svg
│           │           │       ├── Neue-BoldItalic.ttf
│           │           │       ├── Neue-BoldItalic.woff
│           │           │       ├── Neue-Regular.eot
│           │           │       ├── Neue-Regular.svg
│           │           │       ├── Neue-Regular.ttf
│           │           │       ├── Neue-Regular.woff
│           │           │       ├── Neue-RegularItalic.eot
│           │           │       ├── Neue-RegularItalic.svg
│           │           │       ├── Neue-RegularItalic.ttf
│           │           │       ├── Neue-RegularItalic.woff
│           │           │       ├── NeueDisplay-Black.eot
│           │           │       ├── NeueDisplay-Black.svg
│           │           │       ├── NeueDisplay-Black.ttf
│           │           │       ├── NeueDisplay-Black.woff
│           │           │       ├── NeueDisplay-Random.eot
│           │           │       ├── NeueDisplay-Random.svg
│           │           │       ├── NeueDisplay-Random.ttf
│           │           │       ├── NeueDisplay-Random.woff
│           │           │       ├── NeueDisplay-Ultra.eot
│           │           │       ├── NeueDisplay-Ultra.svg
│           │           │       ├── NeueDisplay-Ultra.ttf
│           │           │       ├── NeueDisplay-Ultra.woff
│           │           │       ├── NeueDisplay-Wide.eot
│           │           │       ├── NeueDisplay-Wide.svg
│           │           │       ├── NeueDisplay-Wide.ttf
│           │           │       └── NeueDisplay-Wide.woff
│           │           ├── images/
│           │           │   ├── appleicon.png
│           │           │   ├── background.jpg
│           │           │   └── favicon.ico
│           │           └── js/
│           │               ├── duo/
│           │               │   ├── Duo-Web-v2-fix.js
│           │               │   └── Duo-Web-v2-fix.min.js
│           │               ├── material.min.js
│           │               ├── newschool.js
│           │               └── ripples.min.js
│           └── templates/
│               └── newschool/
│                   ├── casAcceptableUsagePolicyView.html
│                   ├── casAccountDisabledView.html
│                   ├── casAccountLockedView.html
│                   ├── casAuthenticationBlockedView.html
│                   ├── casAuthyLoginView.html
│                   ├── casAzureAuthenticatorLoginView.html
│                   ├── casBadHoursView.html
│                   ├── casBadWorkstationView.html
│                   ├── casConfirmLogoutView.html
│                   ├── casConfirmView.html
│                   ├── casConsentLogoutView.html
│                   ├── casConsentReviewView.html
│                   ├── casConsentView.html
│                   ├── casDuoLoginView.html
│                   ├── casExpiredPassView.html
│                   ├── casGenericSuccessView.html
│                   ├── casGoogleAuthenticatorLoginView.html
│                   ├── casGoogleAuthenticatorRegistrationView.html
│                   ├── casGuaDisplayUserGraphicsView.html
│                   ├── casGuaGetUserIdView.html
│                   ├── casInterruptView.html
│                   ├── casLoginMessageView.html
│                   ├── casLoginView.html
│                   ├── casLogoutView.html
│                   ├── casMfaRegisterDeviceView.html
│                   ├── casMustChangePassView.html
│                   ├── casPac4jStopWebflow.html
│                   ├── casPasswordUpdateSuccessView.html
│                   ├── casPropagateLogoutView.html
│                   ├── casRadiusLoginView.html
│                   ├── casResetPasswordErrorView.html
│                   ├── casResetPasswordSendInstructionsView.html
│                   ├── casResetPasswordSentInstructionsView.html
│                   ├── casResetPasswordVerifyQuestionsView.html
│                   ├── casRiskAuthenticationBlockedView.html
│                   ├── casServiceErrorView.html
│                   ├── casSurrogateAuthnListView.html
│                   ├── casSwivelLoginView.html
│                   ├── casU2fLoginView.html
│                   ├── casU2fRegistrationView.html
│                   ├── casYubiKeyLoginView.html
│                   ├── casYubiKeyRegistrationView.html
│                   ├── error/
│                   │   ├── 401.html
│                   │   ├── 403.html
│                   │   ├── 404.html
│                   │   ├── 405.html
│                   │   └── 423.html
│                   ├── error.html
│                   ├── fragments/
│                   │   ├── bottom.html
│                   │   ├── cas-resources-list.html
│                   │   ├── cookies.html
│                   │   ├── defaultauthn.html
│                   │   ├── footer.html
│                   │   ├── footerButtons.html
│                   │   ├── head.html
│                   │   ├── insecure.html
│                   │   ├── loginProviders.html
│                   │   ├── loginform.html
│                   │   ├── loginsidebar.html
│                   │   ├── logo.html
│                   │   ├── modal.html
│                   │   ├── pwdupdateform.html
│                   │   ├── serviceui.html
│                   │   └── top.html
│                   ├── layout.html
│                   ├── monitoring/
│                   │   ├── attrresolution.html
│                   │   ├── layout.html
│                   │   ├── viewAuthenticationEvents.html
│                   │   ├── viewConfig.html
│                   │   ├── viewConfigMetadata.html
│                   │   ├── viewDashboard.html
│                   │   ├── viewLoggingConfig.html
│                   │   ├── viewSsoSessions.html
│                   │   ├── viewStatistics.html
│                   │   └── viewTrustedDevices.html
│                   └── protocol/
│                       ├── 2.0/
│                       │   ├── casProxyFailureView.html
│                       │   ├── casProxySuccessView.html
│                       │   ├── casServiceValidationFailure.html
│                       │   └── casServiceValidationSuccess.html
│                       ├── 3.0/
│                       │   ├── casServiceValidationFailure.html
│                       │   └── casServiceValidationSuccess.html
│                       ├── casPostResponseView.html
│                       ├── oauth/
│                       │   └── confirm.html
│                       ├── oidc/
│                       │   └── confirm.html
│                       └── openid/
│                           ├── casOpenIdAssociationSuccessView.html
│                           ├── casOpenIdServiceFailureView.html
│                           ├── casOpenIdServiceSuccessView.html
│                           └── user.html


--

DAVID A. CURRY, CISSP
DIRECTOR OF INFORMATION SECURITY
INFORMATION TECHNOLOGY

71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
+1 212 229-5300 x4728david...@newschool.edu

The New School



--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

Fahmi L. Ramdhani

unread,
Sep 28, 2018, 12:59:38 PM9/28/18
to CAS Community
Thank you David. The problem is solved by creating the src/main/resources directory and moving the template files. Thank you very much to all.

Andrew Evans

unread,
Jan 2, 2019, 6:25:18 PM1/2/19
to CAS Community
You need to place resources under your resources directory and not etc/cas/. I am still working out the css and js but I got the html to work that way. I had to copy the default casLoginView and create a theme view under the appropriate folder in templates though.
Reply all
Reply to author
Forward
0 new messages