I'm using spring boot, spring mvc 4, spring security 4 and mysql as my data store for a new web app and I have two questions
I've never used spring security before, but after seeing it, I have a question regarding the queries used to find users' authorities: why does it use username instead of user id. I mean searching for authorities based on user id is much faster and gives the ability to change the username in the future. I tried to overload the usersByUsernameQuery and the authoritiesByUsernameQuery but to use user id but it didn't work (and even if it works, the name of the method is bugging me) .. so please can someone explain to me why they used the username?
In the previous php web apps that I worked on, we used to store the salt in the DB along with the password if we want to use BCrypt .. but I notice that it is not required to have this column in Spring .. so is the salt part of the encryption and Spring internally knows how to use it so I shouldn't worry about number of iterations, cost and salt storing?