public class WildflyUserPropertiesManager extends BaseWildflyPropertiesManager implements UserManager, ContextualManager
Users manager service provider implementation for JBoss Wildfly, when using default realm based on properties files.
Modifier and Type | Class and Description |
---|---|
static class |
WildflyUserPropertiesManager.WildflyUsersPropertiesFileLoader
An extension of the default Wildfly's users properties file loader,
but this one supports deleting users and using empty passwords.
|
UserManager.UserAttribute
AbstractEntityManager.SearchRequest, AbstractEntityManager.SearchResponse<T>
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PASSWORD |
static String |
DEFAULT_USERS_FILE |
protected String |
usersFilePath |
protected IdentifierRuntimeSearchEngine<org.jboss.errai.security.shared.api.identity.User> |
usersSearchEngine |
protected UserSystemManager |
userSystemManager |
static String |
VALID_USERNAME_SYMBOLS |
DEFAULT_REALM, realm
Constructor and Description |
---|
WildflyUserPropertiesManager() |
WildflyUserPropertiesManager(ConfigProperties gitPrefs) |
WildflyUserPropertiesManager(Map<String,String> gitPrefs) |
Modifier and Type | Method and Description |
---|---|
void |
assignGroups(String username,
Collection<String> groups) |
void |
assignRoles(String username,
Collection<String> roles) |
protected WildflyUserPropertiesManager.WildflyUsersPropertiesFileLoader |
buildFileLoader(String usersFilePath) |
void |
changePassword(String username,
String newPassword) |
org.jboss.errai.security.shared.api.identity.User |
create(org.jboss.errai.security.shared.api.identity.User entity) |
void |
delete(String... usernames) |
void |
destroy() |
org.jboss.errai.security.shared.api.identity.User |
get(String identifier) |
List<org.jboss.errai.security.shared.api.identity.User> |
getAll() |
protected CapabilityStatus |
getCapabilityStatus(Capability capability) |
protected WildflyGroupPropertiesManager |
getGroupsPropertiesManager() |
UserManagerSettings |
getSettings() |
protected List<String> |
getUserNames()
NOTE: To obtain the user names from the UsersFileLoader class, do not use the
getEnabledUserNames method that comes in the jboss domain-management artifcat from Wildfly,
as this method is not present when using the jboss domain-management artifact from EAP modules, as it's version
for 6.4.0.GA is quite older. |
protected WildflyUserPropertiesManager.WildflyUsersPropertiesFileLoader |
getUsersFileLoader() |
String |
getUsersFilePath() |
void |
initialize(UserSystemManager userSystemManager) |
protected void |
loadConfig(ConfigProperties config) |
AbstractEntityManager.SearchResponse<org.jboss.errai.security.shared.api.identity.User> |
search(AbstractEntityManager.SearchRequest request) |
org.jboss.errai.security.shared.api.identity.User |
update(org.jboss.errai.security.shared.api.identity.User entity) |
generateHashPassword, isConfigPropertySet, isEmpty
public static final String DEFAULT_USERS_FILE
public static final String DEFAULT_PASSWORD
public static final String VALID_USERNAME_SYMBOLS
protected final IdentifierRuntimeSearchEngine<org.jboss.errai.security.shared.api.identity.User> usersSearchEngine
protected UserSystemManager userSystemManager
protected String usersFilePath
public WildflyUserPropertiesManager()
public WildflyUserPropertiesManager(ConfigProperties gitPrefs)
protected void loadConfig(ConfigProperties config)
loadConfig
in class BaseWildflyPropertiesManager
public void initialize(UserSystemManager userSystemManager) throws Exception
initialize
in interface ContextualManager
Exception
public void destroy() throws Exception
destroy
in interface ContextualManager
Exception
public AbstractEntityManager.SearchResponse<org.jboss.errai.security.shared.api.identity.User> search(AbstractEntityManager.SearchRequest request) throws SecurityManagementException
search
in interface AbstractEntityManager<org.jboss.errai.security.shared.api.identity.User,UserManagerSettings>
SecurityManagementException
public org.jboss.errai.security.shared.api.identity.User get(String identifier) throws SecurityManagementException
get
in interface AbstractEntityManager<org.jboss.errai.security.shared.api.identity.User,UserManagerSettings>
SecurityManagementException
public List<org.jboss.errai.security.shared.api.identity.User> getAll() throws SecurityManagementException
getAll
in interface AbstractEntityManager<org.jboss.errai.security.shared.api.identity.User,UserManagerSettings>
SecurityManagementException
public String getUsersFilePath()
public org.jboss.errai.security.shared.api.identity.User create(org.jboss.errai.security.shared.api.identity.User entity) throws SecurityManagementException
create
in interface AbstractEntityManager<org.jboss.errai.security.shared.api.identity.User,UserManagerSettings>
SecurityManagementException
public org.jboss.errai.security.shared.api.identity.User update(org.jboss.errai.security.shared.api.identity.User entity) throws SecurityManagementException
update
in interface AbstractEntityManager<org.jboss.errai.security.shared.api.identity.User,UserManagerSettings>
SecurityManagementException
public void delete(String... usernames) throws SecurityManagementException
delete
in interface AbstractEntityManager<org.jboss.errai.security.shared.api.identity.User,UserManagerSettings>
SecurityManagementException
public void assignGroups(String username, Collection<String> groups) throws SecurityManagementException
assignGroups
in interface UserManager
SecurityManagementException
public void assignRoles(String username, Collection<String> roles) throws SecurityManagementException
assignRoles
in interface UserManager
SecurityManagementException
public void changePassword(String username, String newPassword) throws SecurityManagementException
changePassword
in interface UserManager
SecurityManagementException
public UserManagerSettings getSettings()
getSettings
in interface AbstractEntityManager<org.jboss.errai.security.shared.api.identity.User,UserManagerSettings>
protected CapabilityStatus getCapabilityStatus(Capability capability)
protected WildflyUserPropertiesManager.WildflyUsersPropertiesFileLoader buildFileLoader(String usersFilePath) throws Exception
Exception
protected List<String> getUserNames()
getEnabledUserNames
method that comes in the jboss domain-management artifcat from Wildfly,
as this method is not present when using the jboss domain-management artifact from EAP modules, as it's version
for 6.4.0.GA is quite older. So in order to be compatible with both wildfly and eap, do not use the getEnabledUserNames
method.protected WildflyUserPropertiesManager.WildflyUsersPropertiesFileLoader getUsersFileLoader() throws Exception
Exception
protected WildflyGroupPropertiesManager getGroupsPropertiesManager()
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.