Obtaining Client Information
When the Gateway forwards a client request to any internal server, it
adds HTTP headers to the HTTP request. You can use these headers to
obtain additional client information and detect the presence of the Gateway.
To view the HTTP request headers, set the entry in the platform.conf file to gateway.error=message. And, then use
the request.getHeader() from the servlet API. The following
table lists the information in the HTTP headers.
Table 2–3 Information
in HTTP Headers
Header
|
Syntax
|
Description
|
PS-GW-PDC
|
X-PS-GW- PDC: true/false
|
Indicates whether PDC is enabled at the Gateway.
|
PS-Netlet
|
X-PS-Netlet:enabled=true/false
|
Indicates whether Netlet has been enabled or disabled at the Gateway.
If Netlet is enabled, then the encryption option is populated, indicating
whether the Gateway is running in HTTPS (encryption=ssl)
or in HTTP mode (encryption=plain)
For example:
-
PS-Netlet: enabled=false
Netlet
is disabled.
-
PS-Netlet: enabled=true; encryption=ssl
Netlet is enabled with the Gateway running in SSL mode.
The encryption=ssl or encryption=plainis not populated
when Netlet is not enabled.
|
PS-GW-URL
|
X-PS-GW-URL: http(s)://gatewayURL(:port)
|
Indicates the URL that the client is connected to.
When the port is non-standard, for example, if the Gateway is in HTTP/HTTPS
mode and the port is not 80/443, then the :port is also
populated.
|
PS-GW-Rewriting-URL
|
X-PS-GW-URL: http(s)://gatewayURL(:port)/[SessionInfo]
|
Indicates the URL that the Gateway rewrites all the pages to.
-
When the browser supports cookies, the value of this header
is the same as the PS-GW-URL header.
-
When the browser does not support cookies:
-
the destination host is in the "User Session to which User
Session Cookie is Forwarded" field, the value is the actual URL to which the
Gateway rewrites the page to (including the encoded SessionID information).
-
the destination host is not in the User Session to which User
Session Cookie is Forwarded field, then the SessionInfo string
is $SessionID
Note –
As part of the response, if the user's Access Manager sessionId
changes (like response from authentication page) then the pages are rewritten
with that value (and not the value that was previously indicated in the header).
For example:
-
If the browser supports cookies:
PS-GW-Rewriting-URL: https://siroe.india.sun.com:10443/
PS-GW-Rewriting-URL: https://siroe.india.sun.com:10443/SessIDValCustomEncodedValue/
PS-GW-Rewriting-URL: https://siroe.india.sun.com:10443/$SessionID
|
PS-GW-CLientIP
|
X-PS-GW-CLientIP: IP
|
Indicates the IP that the Gateway obtained from recievedSocket.getInetAddress().getHostAddress()
This value provides the client's IP if directly connected to the Gateway.
|