<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to get the client IP Address?</title><link>https://answers.axonivy.com/questions/3566/how-to-get-the-client-ip-address</link><description>&lt;p&gt;Is it possible to get somehow the client IP-Address, when the user opens a User Dialog?
For example the user is logged in and have the task list open, then opens one Task =&amp;gt; start Method of an "User Dialog" gets called. And after this i would like to add an Script step (or anything else) to read the users client IP Address.&lt;/p&gt;
&lt;p&gt;I already tried to find it somewhere in "ivy.session" or "ivy.request" without success.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3566/how-to-get-the-client-ip-address" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 04 Dec 2018 02:54:09 -0500</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/3566/how-to-get-the-client-ip-address/3567</link><description>&lt;p&gt;There is no safe way to get it, but basically you can interpret the request headers as described here: &lt;a href="https://stackoverflow.com/questions/16558869/getting-ip-address-of-client"&gt;https://stackoverflow.com/questions/16558869/getting-ip-address-of-client&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To get access to this API you just need to cast the the IRequest instance up:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IRequest request = Ivy.request();
if (request instanceof IHttpRequest)
{
  HttpServletRequest tomcatRequest = (IHttpRequest)Ivy.request()).getHttpServletRequest();
  // do header analysis...
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Tue, 04 Dec 2018 02:54:09 -0500</pubDate><guid>https://answers.axonivy.com/questions/3566/how-to-get-the-client-ip-address/3567</guid></item></channel></rss>