Deployment Example: Single Sign-On, Load Balancing and Failover Using Sun OpenSSO Enterprise 8.0

9.2 Configuring the J2EE Policy Agents Load Balancer

From a performance perspective, each policy agent validates user sessions and evaluates applicable policies. The results of those actions are cached by the policy agent that performed them. If simple persistence is not set, each agent builds its own cache, effectively doubling the workload on the OpenSSO Enterprise servers, and cutting overall system capacity. The problem will become more acute as the number of policy agents increases. In situations where each web policy agent instance is protecting identical resources, some form of load balancer persistence is highly recommended for these reasons. Although the actual type of persistence may vary when a different load balancer is used, it should achieve the goal of sending requests from the same user session to the same policy agent. Thus we deploy Load Balancer 5 to handle traffic for the J2EE policy agents, and configure the Load Balancer for simple persistence. Use the following list of procedures as a checklist for configuring the J2EE policy agents' load balancer.

  1. To Configure the J2EE Policy Agents Load Balancer

  2. To Add Load Balancer 5 as a Virtual Host by Modifying the J2EE Policy Agent Properties

  3. To Configure Policy for the J2EE Policy Agents

  4. To Verify the J2EE Policy Agent Load Balancer Configuration is Working Properly

ProcedureTo Configure the J2EE Policy Agents Load Balancer

Before You Begin

The load balancer hardware and software used for this deployment is BIG-IP® manufactured by F5 Networks. If you are using different load balancer software, see the documentation that comes with that product for detailed settings information.

  1. Access https://is-f5.example.com, the Big IP load balancer login page, from a web browser.

  2. Log in using the following information:

    User name:

    username

    Password:

    password

  3. Click Configure your BIG-IP (R) using the Configuration Utility.

  4. Create a Pool.

    A pool contains all the backend server instances.

    1. In the left pane, click Pools.

    2. On the Pools tab, click Add.

    3. In the Add Pool dialog, provide the following information:

      Pool Name

      J2EEAgent-Pool

      Load Balancing Method

      Round Robin

      Resources

      Add the Application Server IP addresses and port numbers: pr-1:1081 and pr-2:1081.

    4. Click Done.

    5. In the List of Pools, click J2EEAgent-Pool.

    6. Click the Persistence tab and provide the following information:

      Persistence Type:

      Choose Active Http Cookie


      Note –

      Active Http Cookie persistence uses an HTTP cookie stored on a client computer to allow the client to reconnect to the same server previously visited.


      Method:

      Choose Insert

    7. Click Apply.

  5. Add a Virtual Server.

    The virtual server presents an address to the outside world and, when users attempt to connect, it would forward the connection to the most appropriate real server.


    Note –

    If you encounter JavaScript errors or otherwise cannot proceed to create a virtual server, try using Internet Explorer for this step.


    1. In the left frame, click Virtual Servers.

    2. On the Virtual Servers tab, click Add.

    3. In the Add a Virtual Server dialog box, provide the following information:

      Address

      Enter the IP address for lb-5.example.com

      Services Port

      91

    4. Continue to click Next until you reach the Pool Selection dialog box.

    5. In the Pool Selection dialog box, assign the J2EEAgent-Pool pool.

    6. Click Done.

  6. Add Monitors.

    Monitors are required for the load balancer to detect the backend server failures.

    1. Click Monitors in the left frame.

    2. Click the Basic Associations tab.

    3. Mark the Add checkbox for the IP address for pr–1:1081 and pr–2:1081.

    4. At the top of the Node column, select tcp.

    5. Click Apply.

  7. Log out of the load balancer console.

ProcedureTo Add Load Balancer 5 as a Virtual Host by Modifying the J2EE Policy Agent Properties

In order to configure the J2EE policy agents to point to Load Balancer 5, modify the J2EE agent properties — adding Load Balancer 5 as the virtual host.

  1. Access https://osso-1.example.com:1081/opensso/console from a web browser.

  2. Log in to the OpenSSO Enterprise console as the administrator.

    Username

    amadmin

    Password

    ossoadmin

  3. Under the Access Control tab, click / (Top Level Realm).

  4. Click the Agents tab.

  5. Click the J2EE tab.

    j2eeagent-1 and j2eeagent-2 are displayed under the Agent table.

  6. Click j2eeagent-1

    The Global tab is displayed.

  7. Enter a key and value for the FQDN Virtual Host Map and click Add.

    The key and the value is the name of the host machine in which Load Balancer 5 is installed.

    Map Key

    lb-5.example.com.

    Corresponding Map Value

    lb-5.example.com

  8. Click Save.

  9. Click Back to Main Page.

  10. Click j2eeagent-2

    The Global tab is displayed.

  11. Enter a key and value for the FQDN Virtual Host Map and click Add.

    The key and the value is the name of the host machine in which Load Balancer 5 is installed.

    Map Key

    lb-5.example.com.

    Corresponding Map Value

    lb-5.example.com

  12. Click Save.

  13. Click Back to Main Page.

ProcedureTo Configure Policy for the J2EE Policy Agents

The policies you create here are used in To Verify the J2EE Policy Agent Load Balancer Configuration is Working Properly.

Before You Begin

This procedure assumes that you have just completed To Add Load Balancer 5 as a Virtual Host by Modifying the J2EE Policy Agent Properties and are still logged into the OpenSSO Enterprise console.

  1. Under the Access Control tab, click / (Top Level Realm).

  2. Click the Policies tab.

  3. Click New Policy.

    The New Policy page is displayed.

  4. On the New Policy page, enter URL Policy for LoadBalancer-5 in the Name field.

  5. Click New under Rules.

    The New Rules page is displayed.

  6. On the New Rules page, accept the default URL Policy Agent (with resource name) and click Next.

  7. On the resulting page, provide the following information.

    Name:

    Rule for LoadBalancer-5.

    Resource Name:

    http://lb-5.example.com:91/*

    GET

    Mark this checkbox and verify that Allow is selected.

    POST

    Mark this checkbox and verify that Allow is selected.

  8. Click Finish.

  9. On the New Policy page again, under Subjects, click New.

  10. On the resulting page, verify that Access Manager Identity Subject is selected, and click Next.

  11. On the resulting page, provide the following information:

    Name:

    LoadBalancer-5_Groups

    Filter:

    In the drop-down list, select Group and click Search.

    The search returns a list of available groups.

  12. Select Employee-Group and Manager-Group and click Add.

    The Employee-Group and Manager-Group groups are in the Selected List.

  13. Click Finish.

  14. On the resulting page, click OK.

    The created policy is displayed in the list of Policies.

  15. Log out of the OpenSSO Enterprise console and close the browser.

ProcedureTo Verify the J2EE Policy Agent Load Balancer Configuration is Working Properly

  1. Access http://lb-5.example.com:91/agentsample/index.html from a web browser.

    The Sample Application welcome page is displayed.

  2. Click the J2EE Declarative Security link.

  3. On the resulting page click Invoke the Protected Servlet.

    The policy agent redirects to the OpenSSO Enterprise login page.

  4. Log in to OpenSSO Enterprise as testuser1.

    Username

    testuser1

    Password

    password

    If you can successfully log in as testuser1 and the J2EE Policy Agent Sample Application page is displayed, this first part of the test succeeded and authentication is working as expected.

  5. Click the J2EE Declarative Security link to return.

  6. On the resulting page, click Invoke the Protected Servlet.

    If the Successful Invocation message is displayed, this second part of the test has succeeded and the sample policy for the employee role has been enforced as expected.

  7. Close the browser.

  8. Open a new browser and access http://lb-5.example.com:91/agentsample/index.html.

    The Sample Application welcome page is displayed.

  9. Click the J2EE Declarative Security link.

  10. On the resulting page click Invoke the Protected Servlet.

    The policy agent redirects to the OpenSSO Enterprise login page.

  11. Log in to OpenSSO Enterprise as testuser2.

    Username

    testuser2

    Password

    password

    If the Access to Requested Resource Denied message is displayed, this third part of the test succeeded and the sample policy for the manager role has been enforced as expected.

  12. Click the J2EE Declarative Security link to return.

  13. On the resulting page, click Invoke the Protected EJB via an Unprotected Servlet.

    If the Successful Invocation message is displayed, the sample policy for the employee role has been enforced as expected.

  14. Close the browser.