b1af3d00ee
This is a better option than using the toString() method where the latter doesn't return the username. e.g when the principal is a UserDetails.