2015-12-06 5 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://.+" 
    }