Deployment Example 1: Access Manager 7.1 Load Balancing, Distributed Authentication UI, and Session Failover

10.2 Configuring the J2EE Policy Agents Load Balancer

Load Balancer 6 handles traffic for the J2EE policy agents, and is configured for simple persistence so that browser requests from the same IP address will always be directed to the same policy agent. From a performance perspective, each policy agent validates the user session and evaluates applicable policies. The results are subsequently cached by the individual policy agent to improve performance. If load balancer persistence is not set, each agent must build up its own cache, effectively doubling the workload on the Access Manager servers, and cutting overall system capacity in half. The problem becomes even more acute as the number of policy agents increases. Simple persistence guarantees that the requests from the same user session will always be sent to the same policy agent.


Tip –

In situations where each J2EE policy agent instance is protecting identical resources, some form of load balancer persistence is highly recommended for the performance reasons. The actual type of persistence may vary when a different load balancer is used, as long as it achieves the goal of sending the requests from the same user session to the same policy agent.


The following illustration shows the architecture of the policy agents and load balancers.

Figure 10–2 Policy Agents and Load Balancers

Load Balancer 5 handles traffic to web containers.
Load Balancer 6 handles traffic to J2EE containers.


Note –

When firewalls are configured, Load Balancer 6 can be located in a less secure zone.


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 Point the J2EE Policy Agents to Load Balancer 6

  3. To Create Polices for the Agent Resources

  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: ProtectedResource-1:1081 and ProtectedResource-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.

    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 LoadBalancer-6.example.com

      Services Port

      91

      Pool

      J2EEAgent-Pool

    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.

    1. Click the Basic Associations tab.

    2. Mark the Add checkbox for the IP address for ProtectedResource-1 and ProtectedResource-2.

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

    4. Click Apply.

  7. Log out of the load balancer console.

ProcedureTo Point the J2EE Policy Agents to Load Balancer 6

Modify the AMAgent.properties file to point Protected Resource 1 and Protected Resource 2 to Load Balancer 6.

  1. As a root user, log in to the ProtectedResource–1 host machine.

  2. Change to the config directory.


    # cd /export/J2EEPA1/j2ee_agents/am_wl92_agent/agent_001/config
    

    Tip –

    Backup AMAgent.properties before you modify it.


  3. Make the following change to the AMAgent.properties file.

    com.sun.identity.agents.config.fqdn.mapping[LoadBalancer-6.example.com] = LoadBalancer-6.example.com

  4. Save the file and close it.

  5. Log out of the ProtectedResource–1 host machine.

  6. As a root user, log in to the ProtectedResource–2 host machine.

  7. Change to the config directory.


    # cd /export/J2EEPA2/j2ee_agents/am_wl92_agent/agent_001/config
    

    Tip –

    Backup AMAgent.properties before you modify it.


  8. Make the following change to the AMAgent.properties file.

    com.sun.identity.agents.config.fqdn.mapping[LoadBalancer-6.example.com] = LoadBalancer-6.example.com

  9. Save the file and close it.

  10. Log out of the ProtectedResource–2 host machine.

ProcedureTo Create Polices for the Agent Resources

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

  1. Access the Access Manager server, http://AccessManager-1.example.com:1080/amserver/UI/Login, from a web browser.

  2. Log in to the Access Manager console as the administrator.

    Username

    amadmin

    Password

    4m4dmin1

  3. Modify the referral policy for access to Load Balancer 6.

    1. On the Access Control tab, click the top-level realm example.

    2. Click the Policies tab.

    3. Click the Referral URL Policy for users realm link.

    4. On the Edit Policy page, under Rules, click New.

    5. On the resulting page, select URL Policy Agent (with resource name) and click Next.

      This selection is used to define policies that protect HTTP and HTTPS URLs.

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

      Name:

      URL Rule for LoadBalancer-6

      Resource Name:

      http://loadbalancer-6.example.com:91/*


      Note –

      Make sure all letters are lowercase.


    7. Click Finish.

    8. On the resulting page, click Save.

      The new rule is in the Rules list.

  4. Create a policy in the users sub-realm.

    1. On the Access Control tab, click the users link.

    2. Click the Policies tab, and then New Policy.

    3. In the Name field, enter URL Policy for LoadBalancer-6.

    4. Under Rules, click New.

    5. On the resulting page, accept the default URL Policy Agent (with resource name) and click Next.

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

      Name:

      LoadBalancer-6.

      Parent Resource Name:

      From the list, select, http://loadbalancer-6.example.com:91/*.

      Resource Name:

      http://loadbalancer-6.example.com:91/* is automatically entered when you select the Parent Resource Name.

      GET

      Mark the checkbox and select Allow.

      POST

      Mark the checkbox and select Allow.

    7. Click Finish.

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

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

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

      Name:

      LoadBalancer-6_Groups

      Filter:

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

      The search returns a list of available groups.

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

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

    12. Click Finish.

    13. On the resulting page, click OK.

    The policy you just created is now included in the list of Policies.

  5. Log out of the Access Manager console and close the browser.

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

  1. Restart the Application Servers.

    1. As a root user, log in to the ProtectedResource–1 host machine.

    2. Change to the bin directory.


      # cd /usr/local/bea/user_projects/domains/ProtectedResource-1/bin
      
    3. Stop Application Server 1 managed instance.


      # ./stopManagedWebLogic.sh ApplicationsServer-1 t3://localhost:7001
      
    4. Stop the Application Server 1 administration server.


      # ./stopWebLogic.sh
      
    5. Start the Application Server 1 administration server.


      # ./startWebLogic.sh &
      
    6. Start Application Server 1 managed instance.


      # ./startManagedWebLogic.sh ApplicationServer-1 t3://localhost:7001
      
    7. Log out of the ProtectedResource–1 host machine.

    8. As a root user, log in to the ProtectedResource–2 host machine.

    9. Change to the bin directory.


      # cd /usr/local/bea/user_projects/domains/ProtectedResource-2/bin
      
    10. Stop the Application Server 2 managed instance.


      # ./stopManagedWebLogic.sh ApplicationsServer-2 t3://localhost:7001
      
    11. Stop the Application Server 2 administration server.


      # ./stopWebLogic.sh
      
    12. Start the Application Server 2 administration server.


      # ./startWebLogic.sh &
      
    13. Start the Application Server 2 managed instance.


      # ./startManagedWebLogic.sh ApplicationServer-2 t3://localhost:7001
      
    14. Log out of the ProtectedResource–2 host machine.

  2. Access http://LoadBalancer-6.example.com:91/agentsample/index.html from a web browser.

    The Sample Application welcome page is displayed.

  3. Click the J2EE Declarative Security link.

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

    The policy agent redirects to the Access Manager login page.

  5. Log in to the Access Manager console 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.

  6. Click the J2EE Declarative Security link to return.

  7. 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.

  8. Close the browser.

  9. Open a new browser and access http://LoadBalancer-6.example.com:91/agentsample/index.html.

    The Sample Application welcome page is displayed.

  10. Click the J2EE Declarative Security link.

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

    The policy agent redirects to the Access Manager login page.

  12. Log in to the Access Manager console 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.

  13. Click the J2EE Declarative Security link to return.

  14. 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.

  15. Close the browser.