2013-08-23 3 views

답변

2

문제는 authenticationManager입니다. 설명서를 말한다, 당신은 다음과 같이으로 CasAuthenticationProvider를 사용해야합니다

<beans:bean id="casAuthenticationProvider" 
    class="org.springframework.security.cas.authentication.CasAuthenticationProvider"> 
    <beans:property name="authenticationUserDetailsService"> 
     <beans:bean 
      class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper"> 
      <beans:constructor-arg ref="mongoUserDetailsService" /> 
     </beans:bean> 
    </beans:property> 
    <beans:property name="serviceProperties" ref="serviceProperties" /> 
    <beans:property name="ticketValidator"> 
     <beans:bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"> 
      <beans:constructor-arg index="0" value="https://localhost:7443/cas" /> 
     </beans:bean> 
    </beans:property> 
    <!-- Esta clave es única por aplicación --> 
    <beans:property name="key" value="your-provider-auth" /> 
</beans:bean> 

그럼 당신이해야합니다가의 AuthenticationManager에 있으므로 CasAuthenticationProvider를 설정 : 당신이 볼 수 있듯이

<authentication-manager alias="authenticationManager"> 
    <!-- <authentication-provider user-service-ref='mongoUserDetailsService'/> --> 
    <authentication-provider ref="casAuthenticationProvider" />  
</authentication-manager> 

, 사용자 정의 mongoUserDetailsService가 할당되지 않은 authenticationManager하지만 새로운 casAuthenticationProvider를 사용하면 casAuthenticationProvider를 authenticationManager로 설정합니다