提供的服务 localhost 未被授权使用 CAS 代理身份验证

The supplied service localhost is not authorized to use CAS proxy authentication

我已经创建了自己的 CAS 服务器和客户端。它们都位于本地主机上。

我添加了以下 json 服务定义:

{
  "@class" : "org.jasig.cas.services.RegexRegisteredService",
  "serviceId":"^(https?|imaps?)://.*",
  "name" : "localhost",
  "theme" : "localhost",
  "id" : 1,
  "description" : "localhost test CAS client",
  "proxyPolicy" : {
    "allowedToProxy": true,
    "@class" : "org.jasig.cas.services.RefuseRegisteredServiceProxyPolicy"
  },
  "evaluationOrder" : 1,
  "usernameAttributeProvider" : {
    "@class" : "org.jasig.cas.services.DefaultRegisteredServiceUsernameProvider"
  },
  "logoutType" : "BACK_CHANNEL",
  "attributeReleasePolicy" : {
    "@class" : "org.jasig.cas.services.ReturnAllowedAttributeReleasePolicy",
    "principalAttributesRepository" : {
      "@class" : "org.jasig.cas.authentication.principal.DefaultPrincipalAttributesRepository"
    },
    "authorizedToReleaseCredentialPassword" : false,
    "authorizedToReleaseProxyGrantingTicket" : false
  },
  "accessStrategy" : {
    "@class" : "org.jasig.cas.services.DefaultRegisteredServiceAccessStrategy",
    "enabled" : true,
    "ssoEnabled" : true
  }
}

但我不断收到以下异常:

17:43:23.513 [http-nio-8443-exec-2] DEBUG o.j.c.c.v.Cas20ProxyTicketValidator - Server response: 


<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
    <cas:authenticationFailure code='UNAUTHORIZED_SERVICE_PROXY'>
            The supplied service &#039;https://localhost:8443/cas-sample/login/cas&#039; is not authorized to use CAS proxy authentication.
    </cas:authenticationFailure>
</cas:serviceResponse>

17:43:23.515 [http-nio-8443-exec-2] DEBUG o.s.s.c.web.CasAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.BadCredentialsException: 
            The supplied service 'https://localhost:8443/cas-sample/login/cas' is not authorized to use CAS proxy authentication.

我的配置有什么问题吗?

我通过将策略 class 更改为 :

使其正常工作
  "proxyPolicy" : {
    "@class" : "org.jasig.cas.services.RegexMatchingRegisteredServiceProxyPolicy",
    "pattern" : "^https://.+"
  }