Package com.kheops.jmap.server.security
Class AbstractSsoUserManager
java.lang.Object
com.kheops.jmap.server.security.AbstractSsoUserManager
- All Implemented Interfaces:
ExternalAuthenticationService
,UserManager
,Serializable
- Direct Known Subclasses:
OidcUserManager
,Saml2UserManager
public abstract class AbstractSsoUserManager
extends Object
implements UserManager, ExternalAuthenticationService
- See Also:
-
Field Summary
Fields inherited from interface com.kheops.jmap.server.security.UserManager
USERMANAGER_CONF_HOME, USERMANAGER_PROPS_FILENAME, USERMANAGER_PROPS_NAME, USERNAME_ADMINISTRATOR, USERNAME_ANONYMOUS
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractSsoUserManager
(String databaseDriver, String databaseUrl, String databaseUser, String databasePassword) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds a group to the user manager.void
addListener
(UserManagerListener userManagerListener) Adds a listener for user or group changes.boolean
addMemberToGroup
(Group group, User user) Adds a user to a group.boolean
Adds a user to the user manager.authenticate
(String username, String password) Authenticates a user with the specified username and password.boolean
deleteGroup
(String name) Deletes a group from the user manager.boolean
deleteUser
(String username) Deletes a user from the user manager.void
destroy()
Closes this UserManager and resets all registered ACL's.protected void
fireGroupChangedEvent
(Group group) Returns an ExternalAuthenticatorInfo that will be used on the client side to create a new instance of the ExternalAuthenticator to use.Returns the friendly name for this user manager.Returns the group that corresponds to the specified group name.Returns the user that corresponds to the specified username.Group[]
groups()
Returns all groups managed by the user manager.boolean
init()
This method will be used by the implementor to do the necessary initializationboolean
Returns whether this user manager is read only.boolean
load
(Properties properties) void
removeListener
(UserManagerListener userManagerListener) Removes a listener for user or group changes.boolean
removeMemberFromGroup
(Group group, User user) Removes a user from a group.save()
void
setFriendlyName
(String friendlyName) Sets a friendly name for this user manager.boolean
Returns whether this user manager supports groups.boolean
updateUser
(User user) Sets new information for a user.protected void
updateUserToken
(String username, String token) User[]
users()
Returns all users managed by the user manager.void
validate()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.kheops.jmap.server.security.ExternalAuthenticationService
validateAuthenticationToken
Methods inherited from interface com.kheops.jmap.server.security.UserManager
getName, getVersion, search, supportsChangePassword
-
Field Details
-
GROUP_ADMINISTRATORS
- See Also:
-
cipher
-
-
Constructor Details
-
AbstractSsoUserManager
-
-
Method Details
-
init
public boolean init()Description copied from interface:UserManager
This method will be used by the implementor to do the necessary initialization- Specified by:
init
in interfaceUserManager
-
addUser
Description copied from interface:UserManager
Adds a user to the user manager.- Specified by:
addUser
in interfaceUserManager
- Parameters:
user
- the corresponding user to be added.- Returns:
- true if the user was added successfully.
- Throws:
SecurityException
-
addGroup
Description copied from interface:UserManager
Adds a group to the user manager.- Specified by:
addGroup
in interfaceUserManager
- Parameters:
group
- the corresponding group to be added.- Returns:
- true if the group was added successfully.
- Throws:
SecurityException
-
deleteUser
Description copied from interface:UserManager
Deletes a user from the user manager.- Specified by:
deleteUser
in interfaceUserManager
- Parameters:
username
- the corresponding user to be deleted- Returns:
- true if the user was deleted successfully.
- Throws:
SecurityException
-
deleteGroup
Description copied from interface:UserManager
Deletes a group from the user manager.- Specified by:
deleteGroup
in interfaceUserManager
- Parameters:
name
- the corresponding group to be added.- Returns:
- true if the group was deleted successfully.
- Throws:
SecurityException
-
updateUser
Description copied from interface:UserManager
Sets new information for a user.- Specified by:
updateUser
in interfaceUserManager
- Parameters:
user
- the new information to set.- Throws:
SecurityException
-
updateUserToken
-
getUser
Description copied from interface:UserManager
Returns the user that corresponds to the specified username.- Specified by:
getUser
in interfaceUserManager
- Parameters:
username
- the username to search.- Returns:
- the corresponding User instance.
- Throws:
SecurityException
-
getGroup
Description copied from interface:UserManager
Returns the group that corresponds to the specified group name.- Specified by:
getGroup
in interfaceUserManager
- Parameters:
name
- the name to search.- Returns:
- the corresponding Group instance.
- Throws:
SecurityException
-
users
Description copied from interface:UserManager
Returns all users managed by the user manager.- Specified by:
users
in interfaceUserManager
- Returns:
- an User array containing all the users.
- Throws:
SecurityException
-
groups
Description copied from interface:UserManager
Returns all groups managed by the user manager.- Specified by:
groups
in interfaceUserManager
- Returns:
- an Group array containing all the groups
- Throws:
SecurityException
-
authenticate
Description copied from interface:UserManager
Authenticates a user with the specified username and password.- Specified by:
authenticate
in interfaceUserManager
- Parameters:
username
- the username to use.password
- the password to use.- Returns:
- if the authentication was successful, the user that corresponds to the specified username is returned. Otherwise, null is returned.
- Throws:
SecurityException
-
addMemberToGroup
Description copied from interface:UserManager
Adds a user to a group.- Specified by:
addMemberToGroup
in interfaceUserManager
- Parameters:
group
- the corresponding group where the user should be added.user
- to be added to the group.- Throws:
SecurityException
-
removeMemberFromGroup
Description copied from interface:UserManager
Removes a user from a group.- Specified by:
removeMemberFromGroup
in interfaceUserManager
- Parameters:
group
- the corresponding group where the user should be removed.user
- to be removed to the group.- Throws:
SecurityException
-
load
- Specified by:
load
in interfaceUserManager
- Throws:
SecurityException
-
save
- Specified by:
save
in interfaceUserManager
-
isReadOnly
public boolean isReadOnly()Description copied from interface:UserManager
Returns whether this user manager is read only.- Specified by:
isReadOnly
in interfaceUserManager
- Returns:
- true if read only, false otherwise
-
supportsGroups
public boolean supportsGroups()Description copied from interface:UserManager
Returns whether this user manager supports groups.- Specified by:
supportsGroups
in interfaceUserManager
- Returns:
- true if groups are supported, false otherwise
-
setFriendlyName
Description copied from interface:UserManager
Sets a friendly name for this user manager.- Specified by:
setFriendlyName
in interfaceUserManager
- Parameters:
friendlyName
- a friendly name
-
getFriendlyName
Description copied from interface:UserManager
Returns the friendly name for this user manager. If none sets, it returns the name of this user manager.- Specified by:
getFriendlyName
in interfaceUserManager
- Returns:
- friendly name
-
fireGroupChangedEvent
- Throws:
SecurityException
-
addListener
Description copied from interface:UserManager
Adds a listener for user or group changes.- Specified by:
addListener
in interfaceUserManager
- Parameters:
userManagerListener
- the listener object
-
removeListener
Description copied from interface:UserManager
Removes a listener for user or group changes.- Specified by:
removeListener
in interfaceUserManager
- Parameters:
userManagerListener
- the listener object
-
getExternalAuthenticator
Description copied from interface:ExternalAuthenticationService
Returns an ExternalAuthenticatorInfo that will be used on the client side to create a new instance of the ExternalAuthenticator to use.- Specified by:
getExternalAuthenticator
in interfaceExternalAuthenticationService
- Returns:
- the ExternalAuthenticatorInfo instance to use on the client side.
-
validate
- Specified by:
validate
in interfaceUserManager
- Throws:
SecurityException
-
destroy
public void destroy()Description copied from interface:UserManager
Closes this UserManager and resets all registered ACL's.- Specified by:
destroy
in interfaceUserManager
-