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, setRolePermissionResolverassertCredentialsMatch, clearCachedAuthenticationInfo, doGetAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, supportsclearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitencryptPassword, getUserId, getUsersgetAuthenticationInfo, getName, supportscheckPermission, checkPermission, checkPermissions, checkPermissions, checkRole, checkRoles, checkRoles, hasAllRoles, hasRole, hasRoles, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAllsetCacheManagerinitpublic 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 AuthorizingRealmprotected 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 PortofinoRealmpublic Serializable getUserById(String encodedUserId)
PortofinoRealmgetUserById in interface PortofinoRealmencodedUserId - 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)
PortofinoRealmgetUserByEmail in interface PortofinoRealmemail - the email address of the user.public ClassAccessor getSelfRegisteredUserClassAccessor()
PortofinoRealmgetSelfRegisteredUserClassAccessor in interface PortofinoRealmpublic String getUserPrettyName(Serializable user)
PortofinoRealmgetUserPrettyName in interface PortofinoRealmuser - the user's primary principal (as returned by loadAuthenticationInfo()).public void verifyUser(Serializable user)
PortofinoRealmverifyUser in interface PortofinoRealmuser - the user object.public void changePassword(Serializable user, String oldPassword, String newPassword)
PortofinoRealmchangePassword in interface PortofinoRealmuser - 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)
PortofinoRealmgenerateOneTimeToken in interface PortofinoRealmuser - the user object.public String saveSelfRegisteredUser(Object user)
PortofinoRealmsaveSelfRegisteredUser in interface PortofinoRealmuser - the user object to save. It is the same kind of object known by getSelfRegisteredUserClassAccessor().protected void setup(HashService hashService, HashFormat hashFormat)