cancel
Showing results for 
Search instead for 
Did you mean: 

Security code in webDynpro for extranet portal

former_member205363
Contributor
0 Kudos

Hi Friends,

I got some code related to security that we need to take care from webdynpro side in case of extranet portal application.

	 String userId = "";
	 IWDClientUser wdUser = null;
	 IUser user = null;
	 IUserAccount

[] acct = null;

try {

wdUser = WDClientUser.getCurrentUser();

user = wdUser.getSAPUser();

if (user != null) {

acct = user.getUserAccounts();

userId = acct[0].getLogonUid();

if (userId != null) {

//wdContext.currentContextElement().setCustno(strUserID);

//set the current customer to LoggedInUser

wdThis.wdGetContext().currentContextElement().setCurrentCustomer(userId.toUpperCase());

return userId.toUpperCase();

} else {

wdComponentAPI.getMessageManager().reportWarning(" Invalid user1");

}

} else {

wdComponentAPI.getMessageManager().reportWarning(" Invalid user2");

}

} catch (Exception e) {

wdComponentAPI.getMessageManager().reportWarning(" Invalid user3" + e.getMessage());

}

return "";

Is this code really checking the logged in user with the R/3?

Regards,

Lakshmi Prasad.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The code just sets the name of the logged in user to a context variable.

Thanks,

Venkat