org.jboss.seam.security.management
@Name(value="org.jboss.seam.security.identityStore") @Install(precedence=0, value=false) @Scope(value=APPLICATION) @BypassInterceptors public class JpaIdentityStore extends Object implements IdentityStore, Serializable
IdentityStore.Feature, IdentityStore.FeatureSet
Modifier and Type | Field and Description |
---|---|
static String |
AUTHENTICATED_USER |
static String |
EVENT_PRE_PERSIST_USER |
static String |
EVENT_PRE_PERSIST_USER_ROLE |
static String |
EVENT_USER_AUTHENTICATED |
static String |
EVENT_USER_CREATED |
protected IdentityStore.FeatureSet |
featureSet |
Constructor and Description |
---|
JpaIdentityStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
addRoleToGroup(String role,
String group)
Adds the specified role as a member of the specified group.
|
boolean |
authenticate(String username,
String password)
Authenticates the specified user, using the specified password.
|
boolean |
changePassword(String username,
String password)
Changes the password of the specified user to the specified password.
|
boolean |
createRole(String role)
Creates a new role with the specified role name.
|
boolean |
createUser(String username,
String password)
Creates a new user with the specified username and password.
|
boolean |
createUser(String username,
String password,
String firstname,
String lastname)
Creates a new user with the specified username, password, first name and last name.
|
boolean |
deleteRole(String role)
Deletes the specified role.
|
boolean |
deleteUser(String name)
Deletes the user with the specified username.
|
boolean |
disableUser(String name)
Disables the user with the specified username.
|
boolean |
enableUser(String name)
Enables the user with the specified username.
|
String |
generatePasswordHash(String password,
byte[] salt) |
protected String |
generatePasswordHash(String password,
String salt)
Deprecated.
Use JpaIdentityStore.generatePasswordHash(String, byte[]) instead
|
byte[] |
generateUserSalt(Object user)
Generates a 64 bit random salt value
|
Expressions.ValueExpression |
getEntityManager() |
Set<IdentityStore.Feature> |
getFeatures() |
List<String> |
getGrantedRoles(String name)
Returns a list of all the roles explicitly granted to the specified user.
|
List<String> |
getImpliedRoles(String name)
Returns a list of all roles that the specified user is a member of.
|
Class |
getRoleClass() |
List<String> |
getRoleGroups(String name)
Returns a list of all the groups that the specified role is a member of.
|
String |
getRoleName(Object role) |
protected String |
getUserAccountSalt(Object user)
Deprecated.
Use JpaIdentityStore.generateRandomSalt(Object) instead
|
Class |
getUserClass() |
String |
getUserName(Object user) |
boolean |
grantRole(String username,
String role)
Grants the specified role to the specified user.
|
void |
init() |
boolean |
isRoleConditional(String role) |
boolean |
isUserEnabled(String name)
Returns true if the specified user is enabled.
|
List<String> |
listGrantableRoles()
Returns a list of roles that can be granted (i.e, excluding conditional roles)
|
List<Principal> |
listMembers(String role)
Lists the members of the specified role.
|
List<String> |
listRoles()
Returns a list of all the roles.
|
List<String> |
listUsers()
Returns a list of all users.
|
List<String> |
listUsers(String filter)
Returns a list of all users containing the specified filter text within their username.
|
Object |
lookupRole(String role) |
Object |
lookupUser(String username) |
protected Object |
mergeEntity(Object entity) |
protected void |
persistEntity(Object entity) |
protected void |
removeEntity(Object entity) |
boolean |
removeRoleFromGroup(String role,
String group)
Removes the specified role from the specified group.
|
boolean |
revokeRole(String username,
String role)
Revokes the specified role from the specified user.
|
boolean |
roleExists(String name)
Returns true if the specified role exists.
|
void |
setEntityManager(Expressions.ValueExpression expression) |
void |
setFeatures(Set<IdentityStore.Feature> features) |
void |
setRoleClass(Class roleClass) |
void |
setUserAccountForSession() |
void |
setUserClass(Class userClass) |
protected void |
setUserPassword(Object user,
String password) |
boolean |
supportsFeature(IdentityStore.Feature feature)
Returns true if the IdentityStore implementation supports the specified feature.
|
boolean |
userExists(String name)
Returns true if the specified user exists.
|
public static final String AUTHENTICATED_USER
public static final String EVENT_USER_CREATED
public static final String EVENT_PRE_PERSIST_USER
public static final String EVENT_USER_AUTHENTICATED
public static final String EVENT_PRE_PERSIST_USER_ROLE
protected IdentityStore.FeatureSet featureSet
public Set<IdentityStore.Feature> getFeatures()
public void setFeatures(Set<IdentityStore.Feature> features)
public boolean supportsFeature(IdentityStore.Feature feature)
IdentityStore
supportsFeature
in interface IdentityStore
@Create public void init()
public boolean createUser(String username, String password, String firstname, String lastname)
IdentityStore
createUser
in interface IdentityStore
@Deprecated protected String getUserAccountSalt(Object user)
public byte[] generateUserSalt(Object user)
public boolean createUser(String username, String password)
IdentityStore
createUser
in interface IdentityStore
public boolean deleteUser(String name)
IdentityStore
deleteUser
in interface IdentityStore
public boolean grantRole(String username, String role)
IdentityStore
grantRole
in interface IdentityStore
username
- The name of the userrole
- The name of the role to grant to the user.public boolean revokeRole(String username, String role)
IdentityStore
revokeRole
in interface IdentityStore
username
- The name of the userrole
- The name of the role to grant to the user.public boolean addRoleToGroup(String role, String group)
IdentityStore
addRoleToGroup
in interface IdentityStore
role
- The name of the role to add as a membergroup
- The name of the group that the specified role will be added to.public boolean removeRoleFromGroup(String role, String group)
IdentityStore
removeRoleFromGroup
in interface IdentityStore
role
- The name of the role to remove from the group.group
- The group from which to remove the role.public boolean createRole(String role)
IdentityStore
createRole
in interface IdentityStore
public boolean deleteRole(String role)
IdentityStore
deleteRole
in interface IdentityStore
public boolean enableUser(String name)
IdentityStore
enableUser
in interface IdentityStore
public boolean disableUser(String name)
IdentityStore
disableUser
in interface IdentityStore
public boolean changePassword(String username, String password)
IdentityStore
changePassword
in interface IdentityStore
public boolean userExists(String name)
IdentityStore
userExists
in interface IdentityStore
public boolean roleExists(String name)
IdentityStore
roleExists
in interface IdentityStore
public boolean isUserEnabled(String name)
IdentityStore
isUserEnabled
in interface IdentityStore
public List<String> getGrantedRoles(String name)
IdentityStore
getGrantedRoles
in interface IdentityStore
public List<String> getRoleGroups(String name)
IdentityStore
getRoleGroups
in interface IdentityStore
public List<String> getImpliedRoles(String name)
IdentityStore
getImpliedRoles
in interface IdentityStore
@Deprecated protected String generatePasswordHash(String password, String salt)
public boolean authenticate(String username, String password)
IdentityStore
authenticate
in interface IdentityStore
@Observer(value="org.jboss.seam.security.postAuthenticate") public void setUserAccountForSession()
public boolean isRoleConditional(String role)
public List<String> listUsers()
IdentityStore
listUsers
in interface IdentityStore
public List<String> listUsers(String filter)
IdentityStore
listUsers
in interface IdentityStore
public List<String> listRoles()
IdentityStore
listRoles
in interface IdentityStore
public List<Principal> listMembers(String role)
IdentityStore
listMembers
in interface IdentityStore
public List<String> listGrantableRoles()
IdentityStore
listGrantableRoles
in interface IdentityStore
protected void persistEntity(Object entity)
protected void removeEntity(Object entity)
public Class getUserClass()
public void setUserClass(Class userClass)
public Class getRoleClass()
public void setRoleClass(Class roleClass)
public Expressions.ValueExpression getEntityManager()
public void setEntityManager(Expressions.ValueExpression expression)
Copyright © 2015 Seam Framework. All Rights Reserved.