Customizing Views

Existing Views

CAS provides two examples of "skins" out of the box. The default skin is a more complex interface, utilizing CSS. The simple skin is the minimum view needed for CAS to work. The default view is located in {project.home}/webapp/WEB-INF/view/jsp/default/ui/ while the simple views are located in {project.home}/webapp/WEB-INF/view/jsp/simple/ui.

There are four views that you are required to implement:

  • casConfirmView.jsp - The Confirmation screen a user will see when they have chosen "warn"
  • casGenericSuccess.jsp - The screen users will see when they successfully authenticate without coming from a service.
  • casLoginView.jsp - The screen a user sees when they provide their credentials or if there is an error processing their credentials.
  • casLogoutView.jsp - The screen users see after they have ended a CAS Single Sign On Session.

Customizing the Views

The easiest way to start is to either make a copy of the default ui or the simple ui and place it under the {project.home}/webapp/WEB-INF/view/jsp directory such as {project.home}/webapp/WEB-INF/view/jsp/{institution}. Next, edit those JSP pages as needed to customize the UI experience.

After editing the pages, you'll need to let CAS know they exist. This is done by making a copy of {project.home}/webapp/WEB-INF/classes/default_views.properties and changes the location of the views to reflect your new views. Finally, update {project.home}/webapp/WEB-INF/cas-servlet.xml's viewResolver to reflect your properties file instead of default_views.