Style Intelligence v12.0

inetsoft.sree.security
Class FileAuthenticationProvider

java.lang.Object
  extended by inetsoft.sree.security.AbstractAuthenticationProvider
      extended by inetsoft.sree.security.AbstractEditableAuthenticationProvider
          extended by inetsoft.sree.security.FileAuthenticationProvider
All Implemented Interfaces:
AuthenticationProvider, EditableAuthenticationProvider

public class FileAuthenticationProvider
extends AbstractEditableAuthenticationProvider

Authentication module that stores user, password, group and role information on the file system.

Since:
8.5

Field Summary
 
Fields inherited from interface inetsoft.sree.security.AuthenticationProvider
INDIVIDUAL
 
Constructor Summary
FileAuthenticationProvider()
           
 
Method Summary
 void addGroup(Group group)
          Add a group to the system.
 void addRole(Role role)
          Add a role to the system.
 void addUser(User user)
          Add a user to the system.
 boolean authenticate(String user, Object credential)
          Check the authentication of specific entity.
 void changePassword(String user, String password)
          Change the password for an entity.
protected  void fireAuthenticationChanged(String oldName, String newName, int type, boolean removed)
          Notifies all registered listeners that a security object has been removed or renamed.
 Group getGroup(String name)
          Get a group by name.
 String[] getGroups()
          Get a list of all groups defined in the system.
 String[] getIndividualUsers()
          Get a list of all users not in any group except INDIVIDUAL.
 Role getRole(String roleid)
          Get a role object from the role ID.
 String[] getRoles()
          Get a list of all roles in the system.
 String[] getRoles(String user)
          Get a list of all roles bound to specific user.
 User getUser(String name)
          Get a user by name.
 String[] getUsers()
          Get a list of all users in the system.
 String[] getUsers(String group)
          Get a list of all users in a group.
 String[] getUsersByRole(String role)
          Get a list of all users with assigned role.
 void removeGroup(String name)
          Remove a group from the system.
 void removeRole(String name)
          Remove a role from the system.
 void removeUser(String name)
          Remove a user from the system.
 void setGroup(String oname, Group group)
          Set group.
 void setRole(String oname, Role role)
          Set role.
 void setUser(String oname, User user)
          Set user.
 void tearDown()
          Tear down the security provider.
 
Methods inherited from class inetsoft.sree.security.AbstractEditableAuthenticationProvider
addAuthenticationChangeListener, removeAuthenticationChangeListener
 
Methods inherited from class inetsoft.sree.security.AbstractAuthenticationProvider
clearCache, findIdentity, getEmails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface inetsoft.sree.security.AuthenticationProvider
findIdentity, getEmails
 

Constructor Detail

FileAuthenticationProvider

public FileAuthenticationProvider()
Method Detail

getUser

public User getUser(String name)
Get a user by name.

Specified by:
getUser in interface AuthenticationProvider
Overrides:
getUser in class AbstractAuthenticationProvider
Parameters:
name - the unique identifier of the user.
Returns:
the User object that encapsulates the properties of the user.

getUsers

public String[] getUsers()
Get a list of all users in the system.

Specified by:
getUsers in interface AuthenticationProvider
Overrides:
getUsers in class AbstractAuthenticationProvider
Returns:
list of users.

getUsers

public String[] getUsers(String group)
Get a list of all users in a group.

Specified by:
getUsers in interface AuthenticationProvider
Overrides:
getUsers in class AbstractAuthenticationProvider
Parameters:
group - the name of the group, if the group is null returns users belongs no group.
Returns:
list of users

getUsersByRole

public String[] getUsersByRole(String role)
Get a list of all users with assigned role.


getIndividualUsers

public String[] getIndividualUsers()
Get a list of all users not in any group except INDIVIDUAL.

Specified by:
getIndividualUsers in interface AuthenticationProvider
Overrides:
getIndividualUsers in class AbstractAuthenticationProvider
Returns:
list of users

getGroup

public Group getGroup(String name)
Get a group by name.

Specified by:
getGroup in interface AuthenticationProvider
Overrides:
getGroup in class AbstractAuthenticationProvider
Parameters:
name - the name of the group.
Returns:
the named group or null if no such group exists.

getGroups

public String[] getGroups()
Get a list of all groups defined in the system. If groups are nested, only the top level groups should be returned.

Specified by:
getGroups in interface AuthenticationProvider
Overrides:
getGroups in class AbstractAuthenticationProvider
Returns:
list of groups.

getRoles

public String[] getRoles()
Get a list of all roles in the system.

Specified by:
getRoles in interface AuthenticationProvider
Overrides:
getRoles in class AbstractAuthenticationProvider
Returns:
list of roles.

getRole

public Role getRole(String roleid)
Get a role object from the role ID.

Specified by:
getRole in interface AuthenticationProvider
Overrides:
getRole in class AbstractAuthenticationProvider
Parameters:
roleid - the unique identifier of the role.
Returns:
the named role object of null if no such role exists.

getRoles

public String[] getRoles(String user)
Get a list of all roles bound to specific user.

Specified by:
getRoles in interface AuthenticationProvider
Overrides:
getRoles in class AbstractAuthenticationProvider
Parameters:
user - the unique identifier for the user.
Returns:
list of roles.

authenticate

public boolean authenticate(String user,
                            Object credential)
Check the authentication of specific entity.

Parameters:
user - the unique identification of the user.
credential - a wrapper for some secure message, such as the user ID and password.
Returns:
true if the authentication succeeded.

tearDown

public void tearDown()
Tear down the security provider.


changePassword

public void changePassword(String user,
                           String password)
                    throws SRSecurityException
Change the password for an entity. It is supportted only on security realms that use passwords.

Specified by:
changePassword in interface EditableAuthenticationProvider
Overrides:
changePassword in class AbstractEditableAuthenticationProvider
Parameters:
user - the unique identifier of the user.
password - the new password.
Throws:
SRSecurityException - if the password could not be changed.

addUser

public void addUser(User user)
Add a user to the system.

Specified by:
addUser in interface EditableAuthenticationProvider
Overrides:
addUser in class AbstractEditableAuthenticationProvider
Parameters:
user - the user to add.

setUser

public void setUser(String oname,
                    User user)
Set user.

Specified by:
setUser in interface EditableAuthenticationProvider
Overrides:
setUser in class AbstractEditableAuthenticationProvider
Parameters:
oname - old user name.
user - the new user.

removeUser

public void removeUser(String name)
Remove a user from the system.

Specified by:
removeUser in interface EditableAuthenticationProvider
Overrides:
removeUser in class AbstractEditableAuthenticationProvider
Parameters:
name - the name of the user to remove.

addGroup

public void addGroup(Group group)
Add a group to the system.

Specified by:
addGroup in interface EditableAuthenticationProvider
Overrides:
addGroup in class AbstractEditableAuthenticationProvider
Parameters:
group - the group to add.

setGroup

public void setGroup(String oname,
                     Group group)
Set group.

Specified by:
setGroup in interface EditableAuthenticationProvider
Overrides:
setGroup in class AbstractEditableAuthenticationProvider
Parameters:
oname - old group name.
group - the new group.

removeGroup

public void removeGroup(String name)
Remove a group from the system.

Specified by:
removeGroup in interface EditableAuthenticationProvider
Overrides:
removeGroup in class AbstractEditableAuthenticationProvider
Parameters:
name - the name of the group to remove.

addRole

public void addRole(Role role)
Add a role to the system.

Specified by:
addRole in interface EditableAuthenticationProvider
Overrides:
addRole in class AbstractEditableAuthenticationProvider
Parameters:
role - the role to add.

setRole

public void setRole(String oname,
                    Role role)
Set role.

Specified by:
setRole in interface EditableAuthenticationProvider
Overrides:
setRole in class AbstractEditableAuthenticationProvider
Parameters:
oname - old role name.
role - the new role.

removeRole

public void removeRole(String name)
Remove a role from the system.

Specified by:
removeRole in interface EditableAuthenticationProvider
Overrides:
removeRole in class AbstractEditableAuthenticationProvider
Parameters:
name - the name of the role to remove.

fireAuthenticationChanged

protected void fireAuthenticationChanged(String oldName,
                                         String newName,
                                         int type,
                                         boolean removed)
Notifies all registered listeners that a security object has been removed or renamed.

Overrides:
fireAuthenticationChanged in class AbstractEditableAuthenticationProvider
Parameters:
oldName - the old name of the security object.
newName - the new name of the security object.
type - the type of the security object. The value of this parameter must be one of the type constants defined in Identity.
removed - true if the security object has been removed; false otherwise.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.