on 06-14-2006 5:05 PM
Hi there
I'd like to add some attributes to my application users.
I've read about ume.admin.addattrs and ume.admin.self.addattrs and I got it working, I mean, I can see those attributes in the "user admin" of my was server.
How can I read these values in my webdynpro application?
I've tried through IUser interface but it didn't work.
Is there any other way of adding attributes to WAS users?
thanks in advance
That is Ok but I am trying to get those user attributes from a Web Service. This is the code I am running:
IUser user = UMFactory.getUserFactory().getUserByUniqueName(username);
String[] ns = user.getAttributeNamespaces();
String[] attr = user.getAttributeNames(ns[0]);
Neither ns nor attr has the attributes I am looking for.
Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Julio,
Try this
try {
IUser user = UMFactory.getUserFactory().getUserByUniqueName(username);
String salesOrg;
final String[] attribute = user.getAttribute(
"com.sap.security.core.usermanagement",
"NAME_OF_CUSTOM_ATTRIBUTE_FOR_SALES_ORGANIZATION");
if( attribute==null || attribute.length == 0 || !Utils.isNotEmpty(attribute[0]) ) {
//manage error
return;
} else {
salesOrg = attribute[0];
}
} catch (final WDUMException e) {
//manage exception
return;
}
Best regards, Maksim Rashchynski.
Hi Julio,
I think I found the problem:
I played around with this today and had the same problem. First I was thinking it might be because I tried to use my own namespaces. But in the end I found that <b>the attributes (and namespaces) are only present, if the current user has some values configured</b>, i.e. once you set some value for your custom attributes for a user, if that user logs in, you will also find the attributes.
Regards
Markus
Excellent!
That was exactly it.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The namespace "com.sap.security.core.usermanagement" does not have the attributte I am specting.
Could you please explain to me the whole procedure for adding custom user attributes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.