cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture the user who has logged into the portal.

Former Member
0 Kudos

Hi,

How do I capture the user who has logged into the portal.

HOw do I retrieve the first name and last name of the logged in username.

Could someone provide me a related link or PDF to work on this.

Thanks,

Suvarna

Accepted Solutions (1)

Accepted Solutions (1)

sid_sunny
Contributor
0 Kudos

Hi Suvarna,

Visit to this link

Regards

Sid

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Suvarna,

To acheive retrieving portal logged in user in your webDynpro application, and webdynpro application is running on seperate WAS server and not on portal then you need to setup SSO between your portal and WAS server.

Otherwise you will not get User ID using above given code.

Regrads,

Bhavik

Former Member
0 Kudos

Hi Suvarna,

Please check following code. This will definitely work for getting the userid's of portal -

<b>String strUserId= null ;

try {

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

if (user != null )

{

IUserAccount[] acct = user.getUserAccounts();

if (acct[0] != null )

{

strUserId = acct[0].getLogonUid();

return strUserId;

}

}

}

catch (Exception e)

{

return strUserId;

}

return strUserId;</b>

Reply if this works.

Good Day!

ROSHAN

Former Member
0 Kudos

Hi suvarna,

Check the following code

ISearchResult rst = UMFactory.getUserFactory().getUniqueIDs();

IUserFactory usf = UMFactory.getUserFactory();

IUser iuser = null;

IUserListElement userElement = null;

int i = 0;

while (rst.hasNext()) {

iuser =

UMFactory.getUserFactory().getUser(rst.next().toString());

String email = iuser.getEmail();

String fname = iuser.getFirstName();

String lname = iuser.getLastName();

}

regards

Anil Dichpally