public abstract class AbstractPortofinoRealm extends AuthorizingRealm implements PortofinoRealm
Modifier and Type | Field and Description |
---|---|
static String |
copyright |
protected PasswordService |
passwordService |
protected Configuration |
portofinoConfiguration |
Modifier | Constructor and Description |
---|---|
protected |
AbstractPortofinoRealm() |
Modifier and Type | Method and Description |
---|---|
void |
changePassword(Serializable user,
String oldPassword,
String newPassword)
Changes a user's password
|
AuthorizationInfo |
doGetAuthorizationInfo(PrincipalCollection principals)
This default implementation handles built-in groups (all, anonymous, registered, etc.), delegating
to loadAuthorizationInfo method the actual loading of application-specific groups.
|
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.
|
String |
getUserPrettyName(Serializable user)
Computes a string describing the user, meant to be shown on the UI.
|
protected Collection<String> |
loadAuthorizationInfo(Serializable principal)
Loads the groups associated to a given user.
|
String |
saveSelfRegisteredUser(Object user)
Saves a self-registered user on the system.
|
protected void |
setup(HashService hashService,
HashFormat hashFormat) |
void |
verifyUser(Serializable user)
Marks the user as verified as a consequence of a user's action, e.g.
|
afterCacheManagerSet, checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, checkRoles, clearCachedAuthorizationInfo, doClearCache, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getPermissionResolver, getPermissions, getRolePermissionResolver, hasAllRoles, hasRole, hasRole, hasRoles, hasRoles, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, onInit, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setName, setPermissionResolver, setRolePermissionResolver
assertCredentialsMatch, clearCachedAuthenticationInfo, doGetAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, supports
clearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encryptPassword, getUserId, getUsers
getAuthenticationInfo, getName, supports
checkPermission, checkPermission, checkPermissions, checkPermissions, checkRole, checkRoles, checkRoles, hasAllRoles, hasRole, hasRoles, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll
setCacheManager
init
public static final String copyright
protected Configuration portofinoConfiguration
protected PasswordService passwordService
public AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals)
This default implementation handles built-in groups (all, anonymous, registered, etc.), delegating to loadAuthorizationInfo method the actual loading of application-specific groups.
doGetAuthorizationInfo
in class AuthorizingRealm
protected Collection<String> loadAuthorizationInfo(Serializable principal)
principal
- the user object.public Set<String> getGroups()
This default implementation returns the built-in groups (all, anonymous, registered, administrators). You can override it to add custom groups for your application.
getGroups
in interface PortofinoRealm
public Serializable getUserById(String encodedUserId)
PortofinoRealm
getUserById
in interface PortofinoRealm
encodedUserId
- the user id as a String. The security implementation is expected to convert the String
to a value of the appropriate type.public Serializable getUserByEmail(String email)
PortofinoRealm
getUserByEmail
in interface PortofinoRealm
email
- the email address of the user.public ClassAccessor getSelfRegisteredUserClassAccessor()
PortofinoRealm
getSelfRegisteredUserClassAccessor
in interface PortofinoRealm
public String getUserPrettyName(Serializable user)
PortofinoRealm
getUserPrettyName
in interface PortofinoRealm
user
- the user's primary principal (as returned by loadAuthenticationInfo()).public void verifyUser(Serializable user)
PortofinoRealm
verifyUser
in interface PortofinoRealm
user
- the user object.public void changePassword(Serializable user, String oldPassword, String newPassword)
PortofinoRealm
changePassword
in interface PortofinoRealm
user
- the user object.oldPassword
- the old password provided by the user. Must match with the stored one.newPassword
- the new password.public String generateOneTimeToken(Serializable user)
PortofinoRealm
generateOneTimeToken
in interface PortofinoRealm
user
- the user object.public String saveSelfRegisteredUser(Object user)
PortofinoRealm
saveSelfRegisteredUser
in interface PortofinoRealm
user
- the user object to save. It is the same kind of object known by getSelfRegisteredUserClassAccessor().protected void setup(HashService hashService, HashFormat hashFormat)