com.raritantechnologies.security
Class DBSecurityManager
java.lang.Object
com.raritantechnologies.searchApp.SecurityManager
com.raritantechnologies.searchApp.PropertiesSecurityManager
com.raritantechnologies.security.DBSecurityManager
- All Implemented Interfaces:
- IConfigurable, ISecurityManager, IUserAdminManager
- public class DBSecurityManager
- extends PropertiesSecurityManager
- implements IUserAdminManager, ISecurityManager
Perform database lookup for user authentication and authorization.
XML Configuration Template:
<SecurityManager class="com.raritantechnologies.security.DBSecurityManager"
databaseConnectionManager="[ name of DatabaseConnectionManager ]"
alternateLoginName="[ optional - alternate login name to use for this SecurityManager ]" >
<AuthenticationTemplate>[ SQL Template to get user credentials from DB where {USER_ID} and {PASSWORD} placeholders for
user name and password respectively
<!-- Map of User attributes from Authentication query -->
<UserAuthenticationMap>
<!-- One or more Attribute tags: -->
<Attribute sqlColumn="[ column in authentication query response ]"
userAttribute="[ USERNAME | PASSWORD | attribute to be added to user info ]" >
</Attribute>
</UserAuthenticationMap>
<!-- Optional comparator used to compare the user attributes set by the query with an "Authenticated" user profile -->
<AuthenticationComparator class="[ class of com.raritantechnologies.searchApp.ILoginInfoComparator ]" >
</AuthenticationComparator>
<!-- ==================================================================== -->
<!-- Authorization: Acquiring access to specific resources -->
<!-- ==================================================================== -->
<AuthorizationTemplate>[ SQL Template used to get authorizations where {URI} placeholder is used to query for
a specific access request]
<!-- post-filtering for authorization checking -->
<AuthorizationResponseMap>
<Column name="[ name of response column from Authorization request ]"
matchValue="[ optional matching value for valid authorization ]" >
<Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >
</Comparator>
</Column>
</AuthorizationResponseMap>
<UserAuthorizationMap>
<UserAuthorizationElement>
<URIStringFilter>[ optional String filter that will transform canAccess URI ]
<!-- XML Template for an IComparator that will be initialized from user attributes to create an -->
<!-- IComparator that can be used to authenticate the URI access request -->
<AttributeComparatorTemplate>
</AttributeComparatorTemplate>
</UserAuthorizationElement>
</UserAuthorizationMap>
<!-- IUserAdminManager Templates and policy -->
<AddUserTemplate>[ SQL Template to add a User to the DB ]</AddUserTemplate>
<AddUserAdminComparator class="[ class of com.raritantechnologies.searchApp.ILoginInfoComparator ]" >
</AddUserAdminComparator>
<UpdateUserTemplate>[ SQL Template to update a User to the DB ]</UpdateUserTemplate>
<UpdateUserAdminComparator class="[ class of com.raritantechnologies.searchApp.ILoginInfoComparator ]" >
</UpdateUserAdminComparator>
<DeleteUserTemplate>[ SQL Template to Delete a User from the DB ]</UpdateUserTemplate>
<DeleteUserAdminComparator class="[ class of com.raritantechnologies.searchApp.ILoginInfoComparator ]" >
</DeleteUserAdminComparator>
</SecurityManager>
Developed by
Raritan Technologies .
- Author:
- Ted Sullivan
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DBSecurityManager
public DBSecurityManager()
validate
public boolean validate(ILoginInfo user)
- perform db authentication
- Specified by:
validate in interface ISecurityManager- Overrides:
validate in class PropertiesSecurityManager
- Parameters:
user - User information for user executing query
canAccess
public boolean canAccess(ILoginInfo userInfo,
java.lang.String uri,
boolean useDefault)
- Description copied from interface:
ISecurityManager
- Can a user access a particular URI?
- Specified by:
canAccess in interface ISecurityManager- Overrides:
canAccess in class SecurityManager
registerUser
public void registerUser(java.lang.String sessionID,
ILoginInfo loginInfo)
- Specified by:
registerUser in interface ISecurityManager- Overrides:
registerUser in class PropertiesSecurityManager
getUser
public ILoginInfo getUser(java.lang.String sessionID)
- Specified by:
getUser in interface ISecurityManager- Overrides:
getUser in class PropertiesSecurityManager
removeUser
public void removeUser(java.lang.String sessionID)
- Specified by:
removeUser in interface ISecurityManager- Overrides:
removeUser in class PropertiesSecurityManager
addUser
public boolean addUser(ILoginInfo adminLogin,
ILoginInfo userInfo)
- Specified by:
addUser in interface IUserAdminManager
deleteUser
public boolean deleteUser(ILoginInfo adminLogin,
ILoginInfo userInfo)
- Specified by:
deleteUser in interface IUserAdminManager
updateUser
public boolean updateUser(ILoginInfo adminLogin,
ILoginInfo userInfo)
- Specified by:
updateUser in interface IUserAdminManager
initialize
public void initialize(org.w3c.dom.Element elem)
- Description copied from interface:
IConfigurable
- Initializes the object from an XML tag or element.
This method is called by the Framework as part of the application initializtion.
see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory.
Configurable objects that are owned or contained by other configurable objects will be initialized
in by the parent object.
- Specified by:
initialize in interface IConfigurable- Overrides:
initialize in class PropertiesSecurityManager
initialize
public void initialize(java.util.Map params)
- Specified by:
initialize in interface ISecurityManager- Overrides:
initialize in class PropertiesSecurityManager