A
A
Anton Ivanov2020-01-29 21:04:47
Java
Anton Ivanov, 2020-01-29 21:04:47

Why is the service involved in hashing the user's password in Java?

Hello.

I deal with Java using examples from the site baeldung.com.
There was a question about this lesson: https://www.baeldung.com/spring-security-registrat...

Why is the service that creates the user engaged in hashing the user's password?
After all, this leaves the opportunity to set a plain-text password for the user.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2020-01-30
@xez

Because nothing prevents you from doing a password complexity check on the front. And, according to the principle of single-responsibility, this is not a service business - what are the requirements for password complexity. In addition, such checks are just at the front and the place. There is no point in sending the password somewhere to the back, so that it turns out there that the password does not meet the requirements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question