Apereo CAS - Serving Static Resources

Posted by Misagh Moayyed on September 06, 2024 · 2 mins read ·
Content Unavailable
Your browser is blocking content on this website. Please check your browser settings and try again.

Spring Boot provides a convenient way to serve static resources from a list of Resource-based locations. Apereo CAS deployments can take advantage of this feature to display static content and have it dynamically be updated with reasonable caching intervals.

In this post, we will take a brief look at how static resources might be configured in the context of Apereo CAS deployments. Our starting position is as follows:

  • CAS 7.2.x
  • Java 21

Configuration

Spring Boot and Apereo CAS together define the following locations where static resources may be found:

  • file:/etc/cas/static/
  • file:/etc/cas/public/
  • classpath:/META-INF/resources/
  • classpath:/resources/
  • classpath:/static/
  • classpath:/public/

This essentially means that the above paths are mounted onto the root of the cas web application after the context path, /cas. In other words, let’s imagine that you have a /etc/cas/static/hello/world.txt static file. Once in place, you should be able to view its contents by going to https://sso.example.org/cas/hello/world.txt.

Need Help?

If you have questions about the contents and the topic of this blog post, or if you need additional guidance and support, feel free to send us a note and ask about consulting and support services.

Happy Coding,

Misagh Moayyed