on 10-21-2005 12:00 PM
Hello All,
Referring to UME Javadocs : https://media.sdn.sap.com/javadocs/NW04/SP9/ume/index.html
Method of : com.sap.security.api Interface IUser
getUserAccounts()
Returns an array of useraccounts objects which are assigned to the user.
Now what is the meaning of <b>array of useraccounts</b>, b'coz IUser corresponds to single unique user.
Now how a user having a unique id can have multiple user accounts.
Please explain in details.
regards
Santosh
Hi Santosh,
queted from:
In EP5 you could simply call getUid() to obtain the logon ID. However, you will notice that this method is deprecated in EP6. This is primarily due to the fact that a user can be associated with multiple logon accounts. The Javadocs say to use getUniqueId() as a replacement for getUid(), but this returns a value that must be parsed to get the logon ID. You can access the actual logon ID by iterating through the IUserAccounts array obtained by calling getUserAccounts(). The logon ID is retrieved using the new call getLogonUid(). Often times you can simply pick the first element in the array:
String logonID = user.getUid();
IUserAccount accounts[] = null;
try {
accounts = user.getUserAccounts();
} catch (UMException e) {
response.write(("<br>Error getting accounts: " + e.getLocalizedMessage());
}
if (accounts != null) {
response.write("<br>Number of Login Accounts: " + accounts.length);
for (int i = 0; i < accounts.length; i++) {
response.write(
"<br>** Login ID #" + i
+ ": LogonUID=" + accounts[ i ].getLogonUid()
+ ", AssignedUID=" + accounts[ i ].getAssignedUserID());
response.write(
"<br>Last Login: "
+ accounts[ i ].getLastSuccessfulLogonDate().toString());
response.write(
"<br># Logins: " + accounts[ i ].getSuccessfulLogonCounts());
}
}
Hope That helps,
Yoav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yoav,
I believe that in EP userID = LoginID.
So in your above give code, stmt as:
String logonID = user.getUid()/UniqueID();
would definitely return uniqueID of only one user.
So if this is true, how can I retrieve multiple user accounts of a particular EP user?
<u>In other words</u>,
When I create EP user from User Administration in EP, the first field I need to put in is the UserID which is taken to be the LoginID.
When I retrieve the Unique ID of this newly created EP user, the returned loginid string is concatinated with the userid (<i>which is loginid</i>) of the user.
If true, then we need to think of someother key by which we can differenciate an EP user.
Please guide.
Awaiting Reply.
Thanks and Warm Regards,
Ritu R Hunjan
Hi,
This method return you an array of the IUser object. We can use the enumeration techniques to get the IUser data for every user.
Thanks.
Regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
Sorry i didn't understood ur reply.
Referring to the code below:
IUserFactory userfactory = UMFactory.getUserFactory();
IUser user = userfactory.getUserByLogonID("AAA");
// Now this method....
IUserAccount accounts[] = user.getUserAccounts();
Returns all accounts of user AAA.
Since user AAA (LoginID of user AAA) is unique and will have only one account, right then ,what is the purpose of this method.
regards
Santosh
Hi Yoav,
Thanks for ur good explanation.
What i understood from ur reply is,
A portal user can have multiple login ids. ie a unique user id can corresponds to multiple login ids.
Now next question which comes to my mind is when a user is created he is assigned a unique login id, Now how to assign him multiple login ids.
regards
Santosh
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.