-
1. Re: Fetch UserId form Portal
theute Apr 5, 2007 3:14 AM (in response to mac81)You want the username ?
String loggedInUsername = request.getRemoteUser();
-
-
3. Re: Fetch UserId form Portal
theute Apr 5, 2007 5:31 AM (in response to mac81)Well in JSR 168 the username *is* the ID.
That said if you use the userModule you could get the JBoss Portal User object and there is a getId() method on it that returns an object.
In the case of the DB implementation it would return the table id (I guess that's the id you are talking about) in LDAP it would return the username.
If you want to be safe, i suggest you use the username.
1) You can do it in a JSR168 compliant way
2) You are not dependant on the implementation of user module (LDAP or Database or whatever) -
4. Re: Fetch UserId form Portal
mac81 Apr 5, 2007 5:42 AM (in response to mac81)Hi Thomas,
thanks for your answer.
I've already assumed that there's no other option to obtain the user Id (yes, I mean the number and in my specific case I cannot use the name) than to use the "UserModule".
Unfortunately, the UserModule don't work as I use a java bean in the same application (and java beans and UserModule don't harmonize in a managed transaction).
-> http://www.dbforums.com/archive/index.php/t-1078951.html
Greetings,
Mac -
5. Re: Fetch UserId form Portal
theute Apr 5, 2007 6:07 AM (in response to mac81)What are you trying to achieve ? Why do you need the database id for ?
-
6. Re: Fetch UserId form Portal
mac81 Apr 5, 2007 7:47 AM (in response to mac81)A colleague of mine has created a table in the database. The elements which belong to an user are only accessible via the id.