Skip to Content
avatar image
Former Member

Accessing custom attributes in LDAP using WD Java - UME APIs

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 10, 2009 at 03:01 PM

    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

    Add comment
    10|10000 characters needed characters exceeded