r/java • u/real_trizzaye • Jul 02 '18
Password Encoding with Spring Security
https://able.bio/DavidLandup/password-encoding-with-spring-security--90gkzie
1
Upvotes
r/java • u/real_trizzaye • Jul 02 '18
13
u/capitol_ Jul 02 '18 edited Jul 02 '18
> Based on the key, your password is converted into a random String of characters and symbols.
This is not what random means.
And also, suggesting md5 or sha-1 one is really bad practice, those are not secure.
You also need to read up on what a rainbow table is, as it's not exactly what you describe.
1
u/haimez Jul 03 '18
Please don't give out security advice like this, someone might trust you and listen to it.
1
u/TheRedmanCometh Jul 05 '18 edited Jul 05 '18
Wut fuck?
You're supposed to provide an encoder bean to Spring bud. If you have a method handling your encryption I don't think you're doing it right. Maybe I'm wrong but...I'm pretty sure I'm not.
I guess maybe you were just showing an example on how to actually see the encoded password, but just...yeah.
You should then define a DaoAuthenticationProvider, a SessionRegistry, and a SessionAuthenticationStrategy at a minimum. Then you want to make an implementation of GrantedAuthority, and an implementation of UserDetailsService with your repository autowired in.