Tuomas Toivonen
Tuomas Toivonen

Reputation: 23522

Spring Security in-memory user-service with BCrypt (XML configuration)

How to use BCrypt password encoder with in-memory user service using XML namespace configuration? I tried the following:

<bean id="bcrypt" class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"/>
<security:authentication-manager alias="authenticationManager">
    <security:authentication-provider>
        <security:password-encoder ref="bcrypt" />
        <security:user-service id="userService">
            <security:user name="123" password="123" authorities="123" />
        </security:user-service>
    </security:authentication-provider>
</security:authentication-manager>

In this case Spring expects the passwords to be already in salted form. How do I salt the passwords using the encoder with XML config?

Upvotes: 0

Views: 347

Answers (1)

JHall
JHall

Reputation: 93

For testing purposes you can generate BCrypt hashes by using an online tool like this.

Upvotes: 1

Related Questions