Hi,
We are on EP5 and an early service pack (SP2 I think) and we are trying to work out what Java code we need to use to reference the user ID of the user that is currently logged on.
We have tried using the iUser object but we get NULL values.
Our EP is running on Windows and hooked into our corportate LDAP if that makes any difference.
We can get it to work on a local workstation using the PDK but that will only show the user that has typed in their username and password to login to the PDK via its web page. We want to see the Windows username that is logged on to the workstation.
Our EP portal is doing authentication automatically out of the box and it shows the user's name in the top-right of the screen, we just can't seem to be able to work out how to query the user ID from Java code.
If someone knows how to do this it would be appreciated.
Thanks.
Hi,
you have to get an instance of the IPortalComponentRequest like:
doInitialization() {
IPortalComponentRequest request = IPortalComponentRequest) this.getRequest();
IUser loggedOnUser = (IUser)request.getUser().getUser();
String user = loggedOnUser.getId();
}
Regards,
Gerhard
Hi,
Some of the apis in KM need IUser object of the older version of User Mgt of type 'com.sapportals.portal.security.usermanagement.IUser'
But the method request.getUser().getUser() is deprecated. Is there some better way to get the IUser object of the older version
Regards
Add a comment