Security Management System            

Manage user authentication for multiple application.

 

SUMMARY

 

To develop software application that can be used by multiple applications for their user security management provided those applications are using Acegi Security.

TECHNOLOGIES

 

  1. Acegi Security
  2. Eclipse 3.2 IDE for development, debugging.
  3. JBoss-4.0.4.GA as the web server.
  4. SVN version control for versioning and code delivery.
  5. Ant for our build and remote deploy.
  6. Programming Language: Java (jdk 1.5)
  7. JSF for Front end presentation

 

 

PROJECTS IMPLEMENTATION DETAILS

Security is a product, which can be used by other application for their security management. Other application can use this project for creating users and access permissions for their application. Below is the description about how Security is implemented in rPlatform project.

Following is the layout for application:

 

Figure 1

An application is added through database manually.

 

In rPlatform, security configuration is implemented using Acegi Security. For this we need to have various permissions. These permissions are application specific. For each application it will have different permissions. These permissions are added through database manually. Following is a piece of code that should be used to grant a user with permission “ADD”

 

<authz:authorize ifAllGranted = "ADD">                  

    <form action="contractLoad.do" method="post" >

<input type="image" src="images/btns/loadcontract.png" name="submit" value="submit" />                      

     </form>

</authz:authorize>  

 

Following is the page for permissions.

 

Figure 3

 

Pagination and sorting is implemented in the above page. On click of button in the red circle all the data will display for the user in one page.

 

On click of ‘Role’ tab below screen will display for the user.

 

Figure 4

 

On click of ‘Add’ button a new row will create to add a role. User can add a role name and description click the ‘Save’ button to save the record.

 

After creating a role user can add permissions for a particular role. By clicking ‘View Permissions’ button in Figure 4 following screen will be displayed for the user.

 

Figure 5

 

All the permission that we added using the backend database will be displayed for the user in a dropdown box like Figure 5. On click of ‘Add’ button a new row will populate. User can select the permission that he/she wants to avail for a particular role from the drop down box. By clicking the save button this will be saved. There is a ‘Delete’, which allows a user to delete a particular permission for a role.

 

Following is the screen, which allows a user to add a user and roles for that user.

Figure 6

 

On click of ‘Add’ button a new row will be created. We can add a user, by specifying username and password. A user can be enabled or disabled using the enabled column. By clicking the ‘View Role’ button we can view the roles and add or edit role for that particular user.

 

Figure 8

 

All the roles that we added in the Role section will be displayed in the drop down box like the above figure. User can select a role from the above drop down box and click the ‘Save’ button to save.

 

Over all, using below acegi spring bean configuration and this application we can apply security quickly and readily:

 

<bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">

      <property name="dataSource"><ref bean="dataSource"/></property>

      <property name="usersByUsernameQuery">

                     <value>

                               SELECT user_name,password,true as enabled

                               FROM complyez.account

                               WHERE user_name = ?

                     </value>

      </property>

      <property name="authoritiesByUsernameQuery">

            <value>

                                      SELECT distinct u.user_name, p.name

                                      FROM complyez.account u, role r, permission p ,

                                      user_role ur, role_permission rp

                                      WHERE u.user_name = ?

                                      AND u.account_id = ur.user_id

                                      AND ur.role_id = rp.role_id

                                      AND rp.permission_id = p.id;

            </value>

     </property>

   </bean>