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.
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.