Package com.espacogeek.geek.utils
Class UserUtils
java.lang.Object
com.espacogeek.geek.utils.UserUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IntegergetUserID(org.springframework.security.core.Authentication authentication) Extracts the user ID from the given authentication object.static booleanisValidPassword(String password) Validate the password.
-
Constructor Details
-
UserUtils
public UserUtils()
-
-
Method Details
-
isValidPassword
Validate the password.- Returns:
trueif the given password flow all rules andfalseif password doesn't flow any rule.
-
getUserID
Extracts the user ID from the given authentication object. The user ID is assumed to be stored in an authority with the prefix "ID_".- Parameters:
authentication- the authentication object- Returns:
- the user ID
-