I got it working and I am not really sure why it wasn't working. This is what I finally ended up doing.
Added the following dependency to pom.xml (I thought I had done this but maybe I hadn't):
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-webapp-config-security</artifactId>
<version>${cas.version}</version>
</dependency>
And the settings in my cas.properties that made Basic Authentication work were:
# allow access from any IP
cas.adminPagesSecurity.ip=^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$
security.basic.enabled=true
security.basic.realm=CAS
security.user.name=master
# if below is set to blank or is just commented out then a password like the one shown is generated and displayed in the logs
security.user.password=6b934cf6-8162-4dba-878b-ed10eb3ac105
# enable CAS endpoints to be authenticated
cas.monitor.endpoints.enabled=true
cas.monitor.endpoints.sensitive=true
# enable Spring endpoints to be authenticated as well
cas.adminPagesSecurity.actuatorEndpointsEnabled=true
endpoints.enabled=true
endpoints.sensitive=true
One thing to note that I didn't quite understand previously from the documentation is that when endpoints are marked as sensitive it basically seems to mean that you need to authenticate using one of the Spring security mechanisms to gain access. That is why if you are using CAS to authenticate you set sensitive to false.
Doug