2015-12-06 60 views
0

我已經創建了自己的CAS服務器和客戶端。它們都位於本地主機上。提供的服務localhost未被授權使用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. 

有什麼可以不對我的配置?

回答

1

我得到它的工作通過改變政策類:

"proxyPolicy" : { 
    "@class" : "org.jasig.cas.services.RegexMatchingRegisteredServiceProxyPolicy", 
    "pattern" : "^https://.+" 
    } 
相關問題