cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing custom attributes in LDAP using WD Java - UME APIs

Former Member
0 Kudos

Hello Friends,

I am trying to access a custom attribute from LDAP in WebDynpro Java. I am using bellow code.

IWDClientUser clientUser = WDClientUser.getCurrentUser();

IUser sapUser = clientUser.getSAPUser();

if (sapUser != null) {

String[] str_emp = sapUser.getAttribute(<Name Space>,"Attribute Name");

if (str_emp == null || str_emp.length == 0) {

wdComponentAPI.getMessageManager().reportSuccess(" NULL ");

return;

} else {

strEmpID = str_emp[0];

  • }*

}

wdComponentAPI.getMessageManager().reportSuccess(strEmpID);

The name space is "$usermapping$". I am not sure why it is like that only for this attribute i am trying to access.

I am getting null value if i run this code.

Can any one help

thanks

Shobhan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Are you sure this is the right namespace? The default namespace is com.sap.security.core.usermanagement.

You can get all namespaces and the names of all attributes defined for a user using methods getAttributeNamespaces and getAttributeNames : [Interface IPrincipal|http://help.sap.com/javadocs/NW04S/current/se/index.html].

Regards,

Pierre