Pramati Technologies

Setting Security Parameters

A security role is a semantic grouping of permissions that a given type of user of the application must have in order to successfully use the application. Use the User Manager tool, enabled with the integration of JAAS API to develop and test applications under real-world security deployment requirements. This is used for testing purposes (using the XML Security Realm) enabling creation of components that can be deployed on a production-server with any realm (including LDAP, DB, Flat Files etc.).

The application assembler defines a set of security roles for an application and is composed of one or more Enterprise JavaBeans, JavaServer Pages and Servlets.

Securing Application Access

In Studio, the following four basic steps are to be followed by the user to secure the application access:

Securing EJB Components

Java Modules, Ejb Modules and java archives, all make references to security roles to create a secure environment. To add security roles, use the ejb-jar.xml dialog or add it to the specific JAR at packaging time.

With security roles defined for an EJB, specify the Home and Remote Interface methods that each security role should be allowed to invoke. This is method permission. To define method permissions, use the Method Permission node in the ejb-jar.xml dialog or the specific JAR at packaging time.

The Method Permission for each bean includes a list of security roles and a list of methods. All listed security roles can invoke all listed methods.

If there are no security roles defined in the Java Module, EJB Module or JAR, then everybody has a free access to all the bean methods inside them. An assignment restricts the access to a method.

Securing Web Components

Like EJB components, define security for Web components. Follow the given steps:

Example

Guest, User, and Administrator. Adding roles to the module, through "Security Role" function, involves giving the role a name.

Setting Security Constraints

Security constraints can be added only at packaging time and not in the web.xml file of the Web Module. To set security constraints, do the following:

War file on the Desk > Right Click > Open. This brings up the Package tool. Click on the Security Constraint node in the Package tool > Right Click > Add Security Constraints.

This adds a new security constraint to the WAR. For a security constraint to be added, login configuration needs to be defined first. A WAR can contain multiple security-constraints.

Adding Resource Collection

Click on the New button on the security constraint panel to create a new resource collection. Identify the resources that are to be secured and whose access has to be restricted. Group these "related" resources (with respect to security) into a resource-collection.

The resources can be Servlets, JavaServer Pages, HTML files, or gif images. Specify the resource as a URL pattern. For example: /admin/*

Removing Security Constraints

Security Constraints > Security Constraint > Right Click > Remove

Security constraints that were already created can be removed. It deletes all the resource collections of that constraint.

Login Configuration

To set the login configurations, click on the Login Configuration node in the web.xml file or in the WAR file at packaging time.

This is used to configure the authentication method and the realm name that should be used for this application, and the attributes that are needed by the form login mechanism.

Choose from the following options:

Creating Groups and Users

This is done using Studio's User Manager that can be operated from Studio. Groups are those that are defined in the target Server environment.

By defining users and assigning them groups, ensure that the context entered to access the Servlet through the web page remains valid through the application. All EJB methods can recognize the user that logged in through the web page and activate the appropriate method permissions to either grant or deny access - throughout the application session.

To define users and roles, access User Manager from:

Tools > User Manager

The User Manager tool appears and it consists of two panes:

Users

When the User Manager comes up for the first time, a default user name root and password pramati are already created with administrative privileges. Use the User Manager to add and delete more users to the list.

Given a user, it is possible to view the groups that have been assigned to it. A password that the user needs to access the application can also be given. To modify any users in the list, use the Modify button.

Groups

When the User Manager comes up for the first time, one group called administrator is already added to the User Manager. Use the User Manager to add and delete more groups to/from the list. The User Manager also allows sub-groups to be added to the list. To modify these groups and sub-groups from the list, use the Modify button.

Mapping Security References to Groups

It is at deploy time that the application deployer maps the security references defined in the JARs and WARs onto groups. The available groups are defined by the User Manager tool and obtained from security service started by the Server. To map security references to groups, use the Map Security Roles node in the Deploy tool. If there is a problem in obtaining the security service from the Server, please check the Server log in /logs directory, and Server output window in Studio.


Pramati Technologies  © Copyright   TOCPREVNEXTINDEX