public interface PortofinoRealm extends Realm, Authorizer, CacheManagerAware
Modifier and Type | Method and Description |
---|---|
void |
changePassword(Serializable user,
String oldPassword,
String newPassword)
Changes a user's password
|
String |
encryptPassword(String password)
Returns an encrypted or hashed password.
|
String |
generateOneTimeToken(Serializable user)
Generates a one-time token, for use in email validation and password reset.
|
Set<String> |
getGroups()
Returns the list of groups known to the system.
|
ClassAccessor |
getSelfRegisteredUserClassAccessor()
Returns a ClassAccessor that describes the properties which a self-registered user must or can provide to
initiate the sign up process.
|
Serializable |
getUserByEmail(String email)
Loads a user by email address.
|
Serializable |
getUserById(String encodedUserId)
Loads a user by id.
|
Serializable |
getUserId(Serializable user)
Extracts a value that uniquely identifies the user.
|
String |
getUserPrettyName(Serializable user)
Computes a string describing the user, meant to be shown on the UI.
|
Map<Serializable,String> |
getUsers()
Returns the list of users known to the system.
|
String |
saveSelfRegisteredUser(Object user)
Saves a self-registered user on the system.
|
void |
verifyUser(Serializable user)
Marks the user as verified as a consequence of a user's action, e.g.
|
getAuthenticationInfo, getName, supports
checkPermission, checkPermission, checkPermissions, checkPermissions, checkRole, checkRoles, checkRoles, hasAllRoles, hasRole, hasRoles, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll
setCacheManager
static final String copyright
void verifyUser(Serializable user)
user
- the user object.void changePassword(Serializable user, String oldPassword, String newPassword) throws IncorrectCredentialsException
user
- the user object.oldPassword
- the old password provided by the user. Must match with the stored one.newPassword
- the new password.IncorrectCredentialsException
- if the old password does not match with the one
known by the system (e.g. as stored on a LDAP directory).String generateOneTimeToken(Serializable user)
user
- the user object.String encryptPassword(String password)
password
- the plaintext password.ClassAccessor getSelfRegisteredUserClassAccessor()
String saveSelfRegisteredUser(Object user) throws RegistrationException
user
- the user object to save. It is the same kind of object known by getSelfRegisteredUserClassAccessor().RegistrationException
- if the user could not be saved for whatever reason.Map<Serializable,String> getUsers()
Serializable getUserById(String encodedUserId)
encodedUserId
- the user id as a String. The security implementation is expected to convert the String
to a value of the appropriate type.Serializable getUserByEmail(String email)
email
- the email address of the user.String getUserPrettyName(Serializable user)
user
- the user's primary principal (as returned by loadAuthenticationInfo()).Serializable getUserId(Serializable user)
user
- the user's primary principal (as returned by loadAuthenticationInfo()).