Hi All ,
I am trying to fetch client’s machine name and IP address in Infinity’23 . Based on support articles , active x has been deprecated from 7.3 . Please let me know if there are any other ways to get this information
Thanks in advance
Hi All ,
I am trying to fetch client’s machine name and IP address in Infinity’23 . Based on support articles , active x has been deprecated from 7.3 . Please let me know if there are any other ways to get this information
Thanks in advance
Hi @Archana Raja,
Pega doesnt have any option/api to get the client name or IP directly.
But, you can use below code to get the details of the client name and IP. tried couple of methods to check the details.
try {
// get system name
String SystemName = java.net.InetAddress.getLocalHost().getHostName();
String HostAddress= java.net.InetAddress.getLocalHost().getHostAddress();
oLog.infoForced( "System Name : " + SystemName);
oLog.infoForced("Host Address : "+ HostAddress);
}
catch (Exception E) {
System.err.println(E.getMessage());
}
You can check below links for more information/reference
Getting system name using Java
Regards
Sundeep
@Sudha Sundeep D
Hi Sundeep ,
Thanks for your response
I tried this method . But it returns only the server name and ip address of the server. I am looking for a solution to get the machine name and ip address of the device being used to access the application .
@Archana Raja
Hi Archana,
Can you please check pxRequestor (clipboard page) and see if that helps you to gather the necessary information?
pyUserAgent (machine name)
pxReqRemoteAddr (ip address)
pxdeviceType
Hi @Archana Raja,
My search in google gemini ai, returned this response.
Question: how can we find the client machine name and ip address when the application is accessed by a browser?
Response: Unfortunately, it is not possible to reliably determine the client machine name and internal IP address when the application is accessed through a browser. This is due to security and privacy concerns.
Here’s why:
However, there are some alternative options depending on your specific needs:
Client-side:
window.RTCPeerConnection API. However, this is not entirely reliable as some users might be behind proxies or VPNs.Server-side:
It’s important to remember that any solution that attempts to identify users beyond what they explicitly share should be approached cautiously and ethically, respecting privacy and security best practices.
I hope this explanation clarifies the limitations of accessing client machine information through browsers.
Would it be possible for you to share the requirement to see if that can be acheived by any other means.
Thanks
Sundeep