0

i m using spring security for my login page.in this in the database user password is stored using sha-password encoder.now i want to use the same in my spring-security.xml.i tried this

<beans:bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
 <constructor-arg value="256"/>
 </beans:bean>


    <authentication-manager>  
  <authentication-provider> 
    <password-encoder ref="passwordEncoder"/>
  <jdbc-user-service data-source-ref="dataSource"
          users-by-username-query=
            "select email,password, 'true' as enabled from user_login where email=? limit 1"
          authorities-by-username-query=
            "select email, role from user_roles where email =?  " />
      </authentication-provider>
      </authentication-manager>  
 </beans:beans>

i m getting error at

cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'constructor-arg'.
    - Security namespace does not support decoration of element [constructor-arg]
    - Configuration problem: Security namespace does not support decoration of element.

anyone help me for this,please.

1 Answer 1

2

The constructor-arg element is not in the security namespace, but in the beans namespace. So in your case, use:

<beans:constructor-arg value="256"/>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.