该Cas server 使用6.6版本
配置好cas后访问cas client 相关的应用,并没有跳转到登录页面,而是页面报错:
Application Not Authorized to Use CAS
The application you attempted to authenticate to is not authorized to use CAS. This usually indicates that the application is not registered with CAS, or its authorization policy defined in its registration record prevents it from leveraging CAS functionality, or it's malformed and unrecognized by CAS. Contact your CAS administrator to learn how you might register and integrate your application with CAS.
后台报错
>
2022-11-01 13:55:15,467 ERROR [org.apereo.cas.services.web.support.RegisteredServiceResponseHeadersEnforcementFilter] - <Service unauthorized
RegisteredServiceAccessStrategyAuditableEnforcer.java:lambda$execute$6:200
Optional.java:orElseGet:369
RegisteredServiceAccessStrategyAuditableEnforcer.java:execute:194
原因
这是因为cas server 有一個serverId验证,需要验证链接是否,默认是serviceId:https|imaps://*
默认不支持http的:
解决方案,二选一
一是给cas server配置https的ssl验证。参考:CAS Server 6 去掉Https验证_longjuanfengV的博客-CSDN博客
二是去掉https验证。
注意点:
1:cas server 4.2以上去掉https验证需要修改serverId匹配规则。
2:cas server 4.2以下的不需要修改serverId的匹配规则,只需要修改配置即可