Adding Security to a Web Application

You can add security roles and constraints to your Web application.

To add security:

  1. Select web.xml in the WorkSpace Navigator of the Web Application Development perspective.

    The web.xml editor opens.

  2. Select the Security tab.

    The Security page appears displaying defined security roles and constraints.

  3. Click Add in the Security Roles section.

    A new role is added to the Security Roles list with the default name NewSecurityRolex.

  4. (Optional) Change the default name to a unique, descriptive name in the Name field of the General Information section.

  5. (Optional) Type a description for the security role.

  6. Expand the Security Constraints section.

  7. Click Add in the Security Constraints section.

    A new constraint is added to the Security Constraints list with the default name NewSecurityConstraintx and General Information, Web Resource Collections, Authorize Roles and Constraints, and User Data Constraint sections appear.

  8. (Optional) Change the default name to a unique, descriptive name in the Display name field of the General Information section.

  9. In the Web Resource Collection section, to add a Web resource and its HTTP method:

    1. Click Add.

      The Web Resource Collections dialog box appears.

    2. (Optional) Type a description for the security role.

    3. Select the HTTP method or methods that you want to use.

    4. Click Add to add URL patterns.

    5. Click OK.

  10. In the Authorize Roles and Constraints section, to add a role that is authorized to access a Web resource collection with a constraint:

    1. Click Edit.

      The Define Authorization Constraint dialog box appears.

    2. Type a description for the constraint.

    3. Select the Role Name that you want to restraint to apply to.

    4. Click OK.

  11. In the User Data Constraint section, to select a transport guarantee that is required between the client and the server for the security constraint:

    1. Click the arrow in the Type field to open the drop-down list and select the constraint.

      You can select None, Integral, or Confidential.

    2. (Optional) Type a description for the constraint.

Configuring the web xml File

Developing a Web Application

Web.xml Editor

WorkSpace Navigator

Web Application Development Perspective

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com