cancel
Showing results for 
Search instead for 
Did you mean: 

IP and Host Name in Landing Page

ROHITGERA1
Participant
0 Kudos

Hi Folks,

I want to display the IP address and the Host Name of user who open the Portal.

can we use Logon Page war file and then we can change in jsp file?

Thanks & Regards,

Rohit Gera

Accepted Solutions (0)

Answers (1)

Answers (1)

kiruthika_s
Active Participant
0 Kudos

Hi Rohit,

You want the IP and host name of the enduser who accessing the portal url?

Looking for the client machine details?

In the logon page you are going to use a query to pick a select ipaddr, hostname,in that case you can modify logon page

Regards

Kiruthika

ROHITGERA1
Participant
0 Kudos

Yes, Kiruthika,

I want end user machine information ip and host name.

hoe I can do this in logon page.

Thanks,

Rohit Gera

former_member186852
Contributor
0 Kudos

Hi Rohit,

You can set the Parameter " X-FORWARDED-FOR " in portal web dispatcher ,

Make a portal application and use below code to get the client machine IP address.

Sample code :


String ipAddress = request.getHeader("X-FORWARDED-FOR"); 
if (ipAddress == null) { 
  ipAddress
= request.getRemoteAddr(); 
}

Let me know in case of any query.

Regards,

Meghal Shah

ROHITGERA1
Participant
0 Kudos

Hi Meghal,

I already tried your solution, it is working fine but when I am connecting to VPN, it is giving me the VPN IP address instead of client IP.

Thanks & Regards,

Rohit Gera

former_member186852
Contributor
0 Kudos

Hi Rohit,

  • IP addresses may be represented in one header:

            X-Forwarded-For: Client-IP, Proxy1-IP, Proxy2-IP

              

  • IP addresses may also be represented in multiple headers:

  • X-Forwarded-For: Client-IP
  • X-Forwarded-For: Proxy1-IP
  • X-Forwarded-For: Proxy2-IP

Try to check with different header.

Regards,

Meghal Shah