cancel
Showing results for 
Search instead for 
Did you mean: 

Get IP address for an portal user session

0 Kudos

Hi all,

I have a requirement where i need to get the following:

-Client's IP address from where an user is connected to the portal.

-Client's IP address from where someone change a user password (also if the DB keeps user who made the changes will be usefull)

-Client´s IP address from where an user blocks his account

I have checked the NWA (WebAdminApp), and there is a session monitoring where i can see the active sessions on portals and the IP where the user is connected to. I just want to know the API used for that and some information that can guide me. I cant find an API to help me with this, if any of you know something or have any information, it will be usefull.

Regards,

MC

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mariana,

You might want to check the related javadocs:

http://help.sap.com/javadocs/NW04S/SPS09/wd/com/sap/tc/webdynpro/services/sal/adapter/api/WDProtocol...

Code would look something like:


IWDRequest request = WDProtocolAdapter.getProtocolAdapter() .getRequestObject() ;
String clientHostAddress = request.getClientHostAddress();

Hope it helps,

D.

Answers (1)

Answers (1)

pradeep_kumar5
Active Participant
0 Kudos

Hi Mariana,

Use what daniel said, it works fine.

or you can use

import java.net.*;

InetAddress thisIp =InetAddress.getLocalHost();

String IPAddress = thisIp.getHostAddress();

If u want to know the name of the user also then use this code.

try {

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

} catch (WDUMException e) {

e.printStackTrace();

}

Regards,

Pradeep Kumar

Edited by: pradeep_546 on May 11, 2011 11:48 AM