cancel
Showing results for 
Search instead for 
Did you mean: 

how to add custom attributes to UME

Former Member
0 Kudos

hi gurus,

I have developped an appliation in that I want add custom attributes to UME for the sake of retriving the BrandType.

Please give me suggestion how to do this.

Thanks in adance.

Lohi

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Lohi,

UME setup

1) go to Configuration tool (C:\usr\sap\J2E\JC02\j2ee\configtool\consoleconfig.bat)

2) For “Global server configuration->services->com.sap.security.core.ume.service” define property “ume.admin.addattrs” as “BU_PARTNER” and for “ume.admin.self.addattrs” as “<empty>”. (to set value select entry, input value in “Value” field and click “Set”)

3) Click “Apply changes” button on the toolbar.

4) Restart server.

5) Login to http://<server_name>:<server_port>/useradmin/index.jsp and define “BU_PARTNER” property.

Code:

try {
	final IWDClientUser wdUser = WDClientUser.getCurrentUser();
	final IUser user = wdUser.getSAPUser();
		
	final String[] attribute = user.getAttribute(
		"com.sap.security.core.usermanagement", 
		"BU_PARTNER");
				
	if( attribute==null || attribute.length == 0 || !Utils.isNotEmpty(attribute[0]) ) {
		wdComponentAPI.getMessageManager().reportMessage(...);
		return;
	} else {
		buPartner = attribute[0];
	}
} catch (final WDUMException e) {
	wdComponentAPI.getMessageManager().reportMessage(...);
}

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim

Could u pls explain wat do u mean by define property and where?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

you have to add some attributes by the config tool (<a href="http://help.sap.com/saphelp_nw04/helpdata/en/0b/50ad3e1d1edc61e10000000a114084/content.htm">SAP Help</a>).

In your application you can retrieve the attribute values by one of these methods of IPrincipal:


getAttributeNamespaces()
getAttributeNames(java.lang.String namespace) 
getAttribute(java.lang.String namespace, java.lang.String name) 

Regards

Sebastian