<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

Retrieve the Unique X-OAG-Host Value of an Okta Access Gateway Node

Access Gateway

Overview

Each Okta Access Gateway (OAG) node has a unique x-oag-host value returned as a response header to verify front-end load balancer session stickiness. Retrieve this unique value for a session or a specific node by accessing the admin node shell or issuing a command-line request. When a misconfiguration directs a request to an incorrect node, the browser displays one of the following errors:

 

ERROR: Reading content from file: /opt/oag/configs/spgw/config/spgw.json

400: Unknown Host

 

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Okta Access Gateway (OAG)
  • Load Balancing

Solution

How is the x-oag-host value retrieved for all nodes in a cluster?

Log in to the admin node, access the shell, switch to the oagha user, and run the provided script to get the x-oag-host value of all nodes in the cluster.

  1. Log in to the admin node and access the shell.
  2. Switch the user to the oagha user:

    sudo su - oagha
  3. Run this script:

    for ip in $(awk '/ha_destination_nodes|ha_admin_node/ {print $3}' /opt/oag/configs/events/config/ha_configuration.config | awk '{RS=","}{$1=$1}1'); do ssh -qo StrictHostKeyChecking=no $ip "echo "HOSTNAME: " "$ip";echo "Match x-oag-host: "; grep oag /opt/oag/nginx/conf/nginx.conf"; printf "\n\n"; done;

Retrieve the x-oag-host value for a specific node.

Issue a command-line request to the node IP address and search for the x-oag-host response header to get the value for a specific OAG node, repeating this action for all node IP addresses in the cluster.

  • Windows Command Prompt:

$ curl -ski <OAG Node IP> | findstr -i x-oag-host
x-oag-host: bb4a8e623fddfd06d1e1a928762abc2a32d8f8ce40bda5b0d82a13f75041667e

  • Bash:

$ curl -ski <OAG Node IP> | grep -i x-oag-host
x-oag-host: bb4a8e623fddfd06d1e1a928762abc2a32d8f8ce40bda5b0d82a13f75041667e

 

Compare the x-oag-host value in the application request.

Compare the node values with the x-oag-host value in the actual request to the OAG application by replacing the OAG node IP address with the public URL in the command-line requests, or by locating the value in the browser developer tools.

  1. Open the browser's developer tools (for example, Ctrl + Shift + i).
  2. Select the Network tab (wifi symbol in Firefox).
  3. Navigate to the OAG application.
  4. Select the request for the public URL in the Network tab.
  5. In the right pane, scroll down to find the X-Oag-Host value in the Response Headers section.
X-OAG-Host
Loading
Okta Support - Retrieve the Unique X-OAG-Host Value of an Okta Access Gateway Node