cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with NTLM

Former Member
0 Kudos

Hi

I want to get user's IP address using the following code:

javax.servlet.ServletRequest myReuest = request.getServletRequest();

String myAddr = myReuest.getRemoteAddr().toString();

This code is working when I am not using NTLM and I write the complete URL path including the port number (for example http://hostname:50000/irj).

When I try to inter to the portal via NTLM configuration (for example http://hostname/irj) the code return the same IP address for all the users (The code returns the default IP address of local host which is 127.0.0.1).

I think that problem is with configuration of IISProxy.XML file. I bring here the content of IISProxy.XML file.

<?xml version="1.0" encoding="utf-8" ?>

<!DOCTYPE ISAPI-config (View Source for full doctype...)>

- <ISAPI-config version="1.6">

<filter name="IisProxy filter" authentication="forward" log-level="1" log-flags="0" debug-flags="0" priority="high" extension-url="/scripts/IisProxy.dll" remote-address="skip" />

<extension name="IisProxy extension" log-level="1" log-flags="0" debug-flags="0" access="filter" />

- <mapping name="IisProxy samples" log-level="0" debug-flags="-1" log-flags="0" keep-alive="true" use-continue="true" close-socket="true" close-socket-delay="1000" thread-count="100" max-socket-age="37">

- <source access="filter">

<protocol>http</protocol>

<prefix>/irj/</prefix>

</source>

- <source access="filter">

<protocol>http</protocol>

<prefix>/irj</prefix>

<new-prefix>/irj/</new-prefix>

</source>

- <source access="filter">

<protocol>http</protocol>

<prefix>/portal/</prefix>

<new-prefix>/irj/</new-prefix>

</source>

- <source access="filter">

<protocol>http</protocol>

<prefix>/logon/</prefix>

</source>

- <source access="filter">

<protocol>http</protocol>

<prefix>/webdynpro/</prefix>

</source>

- <target>

<protocol>http</protocol>

<host>localhost</host>

<port>50000</port>

</target>

<compress-types min-size="1024">text/html, text/plain</compress-types>

</mapping>

</ISAPI-config>

Could you please help me to solve this issue?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member188977
Contributor
0 Kudos

Hi, you don´t forget the "/" after the irj

your link should be http://hostname/irj/

Regards

Former Member
0 Kudos

You were right, I got the IP from the Header with the "REMOTE_ADDRESS" variable.

Thanks a lot for your effective help.

Yoav.

gregorw
Active Contributor
0 Kudos

Hello Yoav,

if Ignacio gave you the solution please assign him the 10 Points.

Regards

Gregor

Answers (1)

Answers (1)

gregorw
Active Contributor
0 Kudos

Hello Yoav,

you can try to use:

myReuest.getHeader("x-forwarded-for");

Regards

Gregor

Former Member
0 Kudos

Hi Gregor,

Thanks for the reply.

I tried it and that return null,

Do you have any suggestion?

Thankes ahead,

Yoav.

gregorw
Active Contributor
0 Kudos

Hello,

try to output all Header Variables and search for the IP you expect.

Regards

Gregor

Former Member
0 Kudos

Hi Gregor,

I tried to output all Header Variables and no one gave me any IP.

Here the Header Variables I used:

Accept,Referer,Accept-Language,Accept-Encoding,

User-Agent,Host,Connection,Cache-Control,Cookie,NovINet.

Thanks ahead,

yoav.