Java Policy Agents 5.10.3

Prepare for installation

Before you install

Consider the following points before you install:

  • Install AM and Java Agent in different containers

  • Install the container before you install the agent.

  • Install only one Java Agent for each container, and configure as many agent instances as necessary.

  • Install a supported version of the Java runtime environment, as described in Java Requirements. Set the JAVA_HOME environment variable accordingly. The agent installer requires Java.

    $ echo $JAVA_HOME
    /path/to/java
  • For environments with load balancers or reverse proxies, consider the communication between the agent and the AM servers, and between the agent and the client. Configure both AM and the environment before you install the agent. For more information, see Configure load balancers and reverse proxies.

Download and unzip Java Agent

Go to the ForgeRock BackStage website and download an agent based on your architecture, and operating system requirements. Verify the checksum of the downloaded file against the checksum posted on the download page.

Unzip the file in the directory where you plan to store the agent configuration and log files. The following directories are extracted:

Directory Description

bin

The agentadmin installation and configuration program. For more information, see agentadmin command.

config

Configuration templates used by the agentadmin command during installation

data

Not used

etc

Configuration templates used during installation

installer-logs

Location of log files written during installation

legal-notices

Licensing information including third-party licenses

lib

Shared libraries used by the agent

locale

Property files used by the installation program

README

README file containing platform and install information for the agent

Preinstallation tasks

  1. Create a text file for the agent password, and protect it. For example, use commands similar to these, changing the password value and path:

    • Unix

    • Windows

    $ cat > /tmp/pwd.txt
    password
    CTRL+D
    
    $ chmod 400 /tmp/pwd.txt
    C:> type > pwd.txt
    password
    CTRL+Z

    In Windows Explorer, right-click the password file, for example pwd.txt, select Read-Only, and then click OK.

    Although the agent accepts any password length and content, you are strongly encouraged to generate secure passwords. This can be achieved in various ways, for example using a password manager or by using the command line tool agentadmin --key.
  2. In AM, add an agent profile, as described in Create agent profiles:

    The examples in this guide use an agent profile in the top-level realm, with the following values:

    • Agent ID: java-agent

    • Agent URL: http://agent.example.com:80/app

    • Server URL: http://openam.example.com:8080/openam

    • Password: password

  3. In AM, add a policy set and policy, to protect resources with the agent, as described in Configuring policies in AM’s Authorization guide.

    The examples in this guide use a policy set and policy in the top-level realm, with the following values:

    • Policy set:

      • Name: PEP

      • Resource Types: URL

    • Policy:

      • Name: PEP-policy

      • Resource Type: URL

      • Resource pattern: *://*:*/*

      • Resource value: *://*:*/*

      • Actions tab: Allow HTTP GET and POST

      • Subjects tab: All Authenticated Users.

    When you create your own policy set instead of using the default policy set, iPlanetAMWebAgentService, update the following properties in the agent profile:

  4. When you exchange signed OpenID Connect JWTs between AM and the agent, set up a new key and secret as described in Configure Communication With AM Servers. Do not use the default test key pair in a real environment.

Configure communication with AM servers

AM communicates authentication and authorization information to Java Agent by using OpenID Connect (OIDC) JSON web tokens (JWT). To secure the JSON payload, AM and the agent support JWT signing with the RS256 algorithm. For more information, see RFC 7518.

AM uses an HMAC signing key to protect requested ACR claims values between sending the user to the authentication endpoint, and returning from successful authentication.

By default, AM uses a demo key and an autogenerated secret for these purposes. For production environments, perform the steps in the following procedure to create new key aliases and configure them in AM.

Configure AM secret IDs for the agents' OAuth 2.0 provider

By default, AM 6.5 and later versions are configured to:

  • Sign JWTs with the secret mapped to the am.global.services.oauth2.oidc.agent.idtoken.signing secret ID. This secret ID defaults to the rsajwtsigningkey key alias provided in AM’s JCEKS keystore.

  • Sign claims with the secret mapped to the am.services.oauth2.jwt.authenticity.signing secret ID. This secret ID defaults to the hmacsigningtest key alias available in AM’s JCEKS keystore.

For more information about secret stores, see Configuring secret stores in AM’s Security guide.

  1. Create the following aliases in one of the secret stores configured in AM, for example, the default JCEKS keystore:

    • RSA key pair

    • HMAC secret

  2. In the AM console, select Configure > Secret Stores > Keystore Secret Store Name > Mappings, and configure the following secret IDs:

    • The new RSA key alias in the am.global.services.oauth2.oidc.agent.idtoken.signing secret ID.

    • The new HMAC secret in the am.services.oauth2.jwt.authenticity.signing secret ID.

    You might already have a secret configured for this secret ID, because it is also used for signing certain OpenID Connect ID tokens and remote consent requests. For more information, see Secret ID default mappings in AM’s Security guide.

  3. Save your changes.

Create agent profiles

Java Agent requires a profile to connect to and communicate with AM, regardless of whether the agent is in remote configuration mode or local configuration mode.

This section describes how to create an agent profile and inherit properties from a group. Alternatively, create agent profiles by using the /realm-config/agents/WebAgent/{id} endpoint in the REST API.

For more information, see API Explorer in your AM instance.

Create an agent profile in the AM console

  1. In the AM console, select REALMS > realm name > Applications > Agents > Java, and add an agent using the following hints:

    Agent ID

    The ID of the agent profile. This ID resembles a username in AM, and is used during the agent installation. For example, MyAgent.

    When AM is not available, the related error message contains the agent profile name. Consider this in your choice of agent profile name.
    Agent URL

    The URL where the agent resides, for example, http://agent.example.com:80/app. When the agent is in remote configuration mode, the Agent URL is used to populate the agent profile for services, such as notifications.

    Server URL

    The full URL to an AM instance. If AM is deployed in a site configuration (behind a load balancer), enter the site URL. When the agent is in remote configuration mode, the Server URL is used to populate the agent profile for use with as login, logout, naming, and cross-domain SSO.

    Password

    The password the agent uses to authenticate to AM. Use this password when installing an agent.

    Although the agent accepts any password length and content, you are strongly encouraged to generate secure passwords. This can be achieved in various ways, for example using a password manager or by using the command line tool agentadmin --key.

Create an agent profile with the ssoadm command line tool

For information about how to use ssoadm and properties with multiple aliases, see Property aliases.

For more information about ssoadm, see ssoadm in AM’s Reference.

  1. Set up ssoadm, as described in AM’s Setting up administration tools in AM’s Installation.

  2. Create a text file for the agent password, and protect it. For example, use commands similar to these, changing the password value and path:

    • Unix

    • Windows

    $ cat > /tmp/pwd.txt
    password
    CTRL+D
    
    $ chmod 400 /tmp/pwd.txt
    C:> type > pwd.txt
    password
    CTRL+Z

    In Windows Explorer, right-click the password file, for example pwd.txt, select Read-Only, and then click OK.

    Although the agent accepts any password length and content, you are strongly encouraged to generate secure passwords. This can be achieved in various ways, for example using a password manager or by using the command line tool agentadmin --key.
  3. Run the an ssoadm command similar to this to create the agent:

    ./ssoadm create-agent \
    --agentname java-agent \
    --agenttype J2EEAgent \
    --password-file /tmp/pwd.txt \
    --realm / \
    --agenturl http://agent.example.com:80/app \
    --serverurl http://am.example.com:8080/am \
    --adminid uid=amadmin,ou=People,dc=am,dc=myorg,dc=org \
    --attributevalues userpassword=password
    
    Agent configuration was created.
  4. (Optional) Configure additional properties for the agent, by adding them to the --attributevalues option.

    Add the following line to the above example to configure a value for Max Entries in Not-Enforced IP Cache:

    --attributevalues com.sun.identity.agents.config.notenforced.ip.cache.size=2000

Create an agent profile group and inherit settings

Use agent profile groups to set up multiple agents that inherit settings from the group.

  1. In the AM console, select REALMS > realm name > Applications > Agents > Java.

  2. In the Group tab, add a group. Use the URL to the AM server in which to store the profile.

  3. Edit the group configuration as necessary, and save the configuration.

  4. Select REALMS > realm name > Applications > Agents > Java, and select an agent you created previously.

  5. In the Global tab, select Group, and add the agent to the group you created previously. The icon appears next to some properties.

  6. For each property where appears, toggle the icon to set inheritance:

    • Do not inherit the value from the group.

    • Inherit the value from the group.

Create agent administrators for a realm

To create agent profiles when installing Java Agent, you need the credentials of an AM user who can read and write agent profiles.

This section describes how to create an agent administrator for a specific realm. Use this procedure to reduce the scope given to users who create agent profiles.

  1. In the AM console, select REALMS > realm name > Identities.

  2. In the Groups tab, add a group for agent administrators.

  3. In the Privileges tab, enable Log Read and Log Write.

  4. Return to REALMS > realm name > Identities, add agent administrator identities.

  5. For each identity, select the Groups tab, add the user to agent profile administrator group.

  6. Provide each system administrator who installs agents with their agent administrator credentials.

    When installing the agent with the --custom-install option, the system administrator can choose the option to create the profile during installation, and then provide the agent administrator user name and the path to a read-only file containing the agent administrator password. For silent installs, you can add the --acceptLicense option to auto-accept the software license agreement.

Copyright © 2010-2024 ForgeRock, all rights reserved.