2012-05-12 9 views
15

मैं NTLM प्रमाणीकरण कॉन्फ़िगर करने के लिए कोशिश कर रहा हूँ, लेकिन त्रुटि प्राप्त:"मिलान वाइल्डकार्ड सख्त है, लेकिन कोई घोषणा तत्व 'http' के लिए पाया जा सकता है" त्रुटि

cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'.

मैं एक साथ विषयों की एक बहुत कुछ पढ़ा है इसी तरह की त्रुटि, लेकिन मुझे मेरी समस्या का समाधान नहीं मिला।

मेरे security.xml फ़ाइल है कि एक त्रुटि का कारण बनता है:

<beans:beans xmlns="http://www.springframework.org/schema/security" 
    xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans.xsd 
          http://www.springframework.org/schema/security 
          http://www.springframework.org/schema/security/spring-security.xsd" > 

    <http access-denied-page="forms/error403.jsp" entry-point-ref="ntlmEntryPoint" servlet-api-provision="false"> 
     <intercept-url pattern="forms/error403.jsp" filters="none"/> 
     <intercept-url pattern="forms/**" access="ROLE_GUEST,ROLE_OPERATOR,ROLE_ADMIN" /> 
       <custom-filter position="PRE_AUTH_FILTER"/> 
    </http> 

    <authentication-manager alias="mainAuthenticationManager"/> 
    <authentication-provider user-service-ref='userDetailsService' /> 

    <beans:bean id="userDetailsService" 
     class="service.UserInfoService"> 
     <beans:property name="dataSource" ref="dataSource" /> 
     <beans:property name="usersByUsernameQuery" value="select distinct name, ' ' as password, 1 as enabled from TMP_SPRING_USERS where name=?" /> 
     <beans:property name="authoritiesByUsernameQuery" value="select name, role from TMP_SPRING_USERS where name=?" /> 
    </beans:bean> 

    <beans:bean id="ntlmEntryPoint" 
     class="org.springframework.security.ui.ntlm.NtlmProcessingFilterEntryPoint"> 
     <beans:property name="authenticationFailureUrl" value="forms/error403.html" /> 
    </beans:bean> 

    <beans:bean id="exceptionTranslationFilter" 
     class="org.springframework.security.ui.ExceptionTranslationFilter"> 
     <beans:property name="authenticationEntryPoint" ref="ntlmEntryPoint" /> 
    </beans:bean> 

    <beans:bean id="ntlmFilter" 
     class="org.springframework.security.ui.ntlm.NtlmProcessingFilter"> 
     <custom-filter position="NTLM_FILTER" /> 
     <beans:property name="authenticationManager" ref="mainAuthenticationManager" /> 
     <beans:property name="retryOnAuthFailure" value="true" /> 
     <beans:property name="stripDomain" value="true"/> 
     <beans:property name="domainController" value="company.com" /> 
     <beans:property name="jcifsProperties"> 
      <beans:props> 
       <beans:prop key="jcifs.smb.lmCompatibility">0</beans:prop> 
       <beans:prop key="jcifs.smb.client.useExtendedSecurity">false</beans:prop> 
       <beans:prop key="jcifs.smb.client.domain">COMPANY</beans:prop> 
       <beans:prop key="jcifs.smb.client.username">somenycuser</beans:prop> 
       <beans:prop key="jcifs.smb.client.password">AReallyLoooongRandomPassword</beans:prop> 
      </beans:props> 
     </beans:property> 
    </beans:bean> 


</beans:beans> 

क्योंकि संस्करण के रूप में 3.X स्प्रिंग सुरक्षा अब और NTLM विस्तार शामिल नहीं है, मैं इसे http://aloiscochard.blogspot.com/2010/03/spring-security-ntlm-3.html लेख से उपयोग करें।

कृपया मेरी मदद करें।

उत्तर

10

समस्या हल हो गई, मैं वसंत-सुरक्षा-config.jar जोड़ने के लिए भूल गया। इसके अलावा मैंने कुछ सेटिंग्स बदल दीं। सही security.xml है ::

<beans:beans xmlns="http://www.springframework.org/schema/security" 
    xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
          http://www.springframework.org/schema/security 
          http://www.springframework.org/schema/security/spring-security-3.0.4.xsd" > 

    <http access-denied-page="forms/error403.jsp" entry-point-ref="ntlmEntryPoint" servlet-api-provision="false"> 
       <intercept-url pattern="/**" access="ROLE_GUEST,ROLE_OPERATOR,ROLE_ADMIN" /> 
       <custom-filter position="PRE_AUTH_FILTER" ref="ntlmFilter"/> 
     </http> 

    <authentication-manager alias="mainAuthenticationManager"> 
      <authentication-provider user-service-ref="userDetailsService" /> 
     </authentication-manager> 

    <beans:bean id="userDetailsService" 
     class="service.UserInfoService"> 
     <beans:property name="dataSource" ref="dataSource" /> 
     <beans:property name="usersByUsernameQuery" value="select distinct name, ' ' as password, 1 as enabled from TMP_SPRING_USERS where name=?" /> 
     <beans:property name="authoritiesByUsernameQuery" value="select name, role from TMP_SPRING_USERS where name=?" /> 
    </beans:bean> 

    <beans:bean id="ntlmEntryPoint" 
     class="org.springframework.security.ui.ntlm.NtlmAuthenticationFilterEntryPoint"> 
     <beans:property name="authenticationFailureUrl" value="forms/error403.html" /> 
    </beans:bean> 



    <beans:bean id="ntlmFilter" 
     class="org.springframework.security.ui.ntlm.NtlmAuthenticationFilter"> 
       <beans:property name="authenticationManager" ref="mainAuthenticationManager" /> 
     <beans:property name="retryOnAuthFailure" value="true" /> 
     <beans:property name="stripDomain" value="true"/> 
     <beans:property name="domainController" value="company.com" /> 
     <beans:property name="jcifsProperties"> 
      <beans:props> 
       <beans:prop key="jcifs.smb.lmCompatibility">0</beans:prop> 
       <beans:prop key="jcifs.smb.client.useExtendedSecurity">false</beans:prop> 
       <beans:prop key="jcifs.smb.client.domain">COMPANY</beans:prop> 
       <beans:prop key="jcifs.smb.client.username">somenycuser</beans:prop> 
       <beans:prop key="jcifs.smb.client.password">AReallyLoooongRandomPassword</beans:prop> 
      </beans:props> 
     </beans:property> 
    </beans:bean> 


</beans:beans> 
संबंधित मुद्दे