如果你的CAS访问地址是http://localhost/cas,那么默认访问http://localhost/cas/status/dashboard会提示没有访问权限。要打开status需要修改下面的配置。
在application.properties中修改和增加如下的信息:
#enabled要设置为true, sensitive要设置为false
endpoints.enabled=true
endpoints.sensitive=false
endpoints.restart.enabled=true
endpoints.shutdown.enabled=false
management.security.enabled=true
management.security.roles=ACTUATOR,ADMIN
management.security.sessions=if_required
management.context-path=/status
management.add-application-context-header=false
security.basic.authorize-mode=role
security.basic.enabled=true
security.basic.path=/cas/status/**
#只能用127.0.0.1访问才能打开status, 也可以设置为其它的ip,用来保护访问功能只能被内部访问
cas.adminPagesSecurity.ip=127.0.0.1
#cas.adminPagesSecurity.loginUrl=http://localhost/cas/login
#cas.adminPagesSecurity.service=http://localhost/cas/status/dashboard
#cas.adminPagesSecurity.users=file:/adminusers.properties
#cas.adminPagesSecurity.adminRoles[0]=ROLE_ADMIN
#cas.adminPagesSecurity.actuatorEndpointsEnabled=true
cas.monitor.endpoints.dashboard.enabled=true
cas.monitor.endpoints.dashboard.sensitive=false
cas.monitor.endpoints.discovery.enabled=true
cas.monitor.endpoints.discovery.sensitive=false
cas.monitor.endpoints.auditEvents.enabled=true
cas.monitor.endpoints.auditEvents.sensitive=false
cas.monitor.endpoints.authenticationEvents.enabled=true
cas.monitor.endpoints.authenticationEvents.sensitive=false
cas.monitor.endpoints.configurationState.enabled=true
cas.monitor.endpoints.configurationState.sensitive=false
cas.monitor.endpoints.healthCheck.enabled=true
cas.monitor.endpoints.healthCheck.sensitive=false
cas.monitor.endpoints.loggingConfig.enabled=true
cas.monitor.endpoints.loggingConfig.sensitive=false
cas.monitor.endpoints.metrics.enabled=true
cas.monitor.endpoints.metrics.sensitive=false
cas.monitor.endpoints.attributeResolution.enabled=true
cas.monitor.endpoints.attributeResolution.sensitive=false
cas.monitor.endpoints.singleSignOnReport.enabled=true
cas.monitor.endpoints.singleSignOnReport.sensitive=false
cas.monitor.endpoints.statistics.enabled=true
cas.monitor.endpoints.statistics.sensitive=false
cas.monitor.endpoints.trustedDevices.enabled=true
cas.monitor.endpoints.trustedDevices.sensitive=false
cas.monitor.endpoints.status.enabled=true
cas.monitor.endpoints.status.sensitive=false
cas.monitor.endpoints.singleSignOnStatus.enabled=true
cas.monitor.endpoints.singleSignOnStatus.sensitive=false
cas.monitor.endpoints.springWebflowReport.enabled=true
cas.monitor.endpoints.springWebflowReport.sensitive=false
cas.monitor.endpoints.registeredServicesReport.enabled=true
cas.monitor.endpoints.registeredServicesReport.sensitive=false
cas.monitor.endpoints.configurationMetadata.enabled=true
cas.monitor.endpoints.configurationMetadata.sensitive=false
另外在user-details.properties里面增加管理员的帐号信息,只有这里面的帐号才可以访问status